Loop through data and upload to the database.
There is a bug in uploading it as there is no data in the variable. Need to fix that.