parse.com-php-library icon indicating copy to clipboard operation
parse.com-php-library copied to clipboard

Creating a php uploader with parse?

Open acenario opened this issue 12 years ago • 1 comments
trafficstars

Hello,

I seem to be a novice with respect to php, so I am having trouble understanding your sample of upload.php. I have a php upload script for file uploading, but how would I integrate that with parse? I am trying to create a php uploader that would allow for someone to upload a csv document that would then be uploaded to parse and then stored into the class 'dining'. Some sample columns are date, day, and breakfast.

If you could provide any feedback or help that would be greatly appreciated!

acenario avatar May 14 '13 07:05 acenario

Sure check out the below code:

//First parse your csv in an array
//great example here: http://stackoverflow.com/a/8353265/718430

//Next goes your parse code
foreach($csv_data as $data){
  $object = new parseObject('dining');
  $object->date = $data['date'];
  $object->day = $data['day'];
  $object->breakfast = $data['breakfast'];

  $object->save();
}

Check out some object examples here: https://github.com/apotropaic/parse.com-php-library/blob/master/tests/parseObjectTest.php

andrewscofield avatar May 15 '13 15:05 andrewscofield