0

I'm just getting started with developing with using facebook api with php. But I can't seem to figure out why I get only an empty array when I invoke the following query:

$fql = "SELECT message,time FROM status WHERE uid ='".$uid."'";

$response = $facebook->api(array('method' => 'fql.query','query' =>$fql));

print_r($response);

When I use a different query like the following I'm getting result back:

$fql = "SELECT uid2 FROM friend WHERE uid1='".$uid."'";

3 Answers 3

6

There may be an issue with permissions. You may need to grant user_status permission.

See here - http://developers.facebook.com/docs/authentication/permissions

Sign up to request clarification or add additional context in comments.

1 Comment

Hey I think that's most likely the issue. I'll try it out. Thanks Taras!
0

Check your permissions. A great way to do this is to use the FQL Query Tool. Its great to test queries and the permissions you will need to access the data you are querying

Comments

0

I have the similar problem, just instead I use:

{
"id":"SELECT uid1, uid2 FROM friend WHERE uid1 = me()",
"posts":"SELECT message, time FROM status WHERE uid IN (SELECT uid2 FROM #id) ORDER BY time DESC LIMIT 50"
}

As a result I get:

    {
  "name": "posts", 
  "fql_result_set": [
  ]
}

If I change uid2 to uid1: (SELECT uid1 FROM #id) I get my status updates.

2 weeks ago, this was working.

Permissions, in my case are correct.

Note: Query's are in Graph Explorer format, so they can be easyly tested

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.