0

enter link description hereThis is my code in PHP

  $query = new ParseQuery("CourseInfo");
  $query->equalTo("Admin", "username1");
  $results = $query->find();

echo $results;

This is returned via the XMLHTTPRequest and a callback in my JS file.

  • What does Parse send to PHP (I thought an array of objects)?
  • What does PHP send to JS? (I've no idea)
  • How can i access this data in JS?

Thanks!

Update: i found some of the answer here: PHP: echoing array only returns the word array instead of its content

basically, echo $results just returns the string "array".

Using `print_r($results) gives a very large data array/object?

I'll put this into a new question.

Community
  • 1
  • 1
Remzo
  • 103
  • 6
  • you should return json value from php to JS – D Coder Jan 31 '17 at 13:24
  • What is `Parse`, a JS library? You can see the response of an AJAX request by opening the network tab in developer console, selecting the request, and clicking the `response` tab. Accessing depends on the JS request. Is `$results` a string, object, or array? – chris85 Jan 31 '17 at 13:26
  • Parse is a backend / database. I didn't know about the response tab, but it's great! Unfortunately it says ARRAY. haha, $results... i think an array of objects... – Remzo Jan 31 '17 at 13:53

0 Answers0