FQL query returning empty array

350 Views Asked by At

FQL query returning empty.

I run the following FQL in https://developers.facebook.com/tools/explorer:

SELECT uid, name, username, birthday_date, current_location, online_presence FROM user WHERE relationship_status ='Single' AND uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) LIMIT 30 OFFSET 0

She successfully returns all my friends who are single.

However, when I run the PHP, nothing is returned:

$fql = "SELECT uid, name, username, birthday_date, current_location, online_presence FROM user WHERE relationship_status ='Single' AND uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) LIMIT 30 OFFSET 0";

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

Until yesterday it was working fine. Today when I test, it happened.

1

There are 1 best solutions below

4
On

If it runs in the Explorer and not in your PHP app, you are most likely seeing a difference in access token clearance. That is, the access token supplied to Explorer has the permissions needed while the token used for your app does not.

Verify by calling /me/permissions on your PHP application to see what is there.

Your site also gives an invalid api key error

Invalid API Key