JINS M.THOMAS
JINS M.THOMAS

Reputation: 121

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.

Upvotes: 4

Views: 626

Answers (1)

Jayesh Babu
Jayesh Babu

Reputation: 1449

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

Upvotes: 7

Related Questions