Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to retrieve Parse.com User details in php

I am using parse php sdk to handle data in my web page. I have a User class in my database. I am trying to display all user details into my web page. The server connection is correct and working, since it displays all other class details. But it is not working for the User class. Following is my php code.

<?php 
     $query = new ParseQuery("User");
     $results = $query->find();
     echo "Successfully retrieved " . count($results) . " scores.";

    for ($i = 0; $i < count($results); $i++) 
    {
      $object = $results[$i]; 
      echo $object->getObjectId() . ' - ' . $object->get('name');
    }
?>

When I run this code I get the following result

Successfully retrieved 0 scores. 

But I have 6 users in my User class.

like image 326
JINS M.THOMAS Avatar asked Mar 09 '23 15:03

JINS M.THOMAS


1 Answers

Use $query = new ParseQuery("_User"); instead of $query = new ParseQuery("User");

like image 97
Jayesh Babu Avatar answered Mar 27 '23 02:03

Jayesh Babu