Facebook announced possibility to use FQL via Graph API: https://developers.facebook.com/blog/post/579/
That is very nice, but I’d like to use it via PHP SDK as all my application uses it and all authorization goes through that library. I have the newest Git version of SDK, but this:
$facebook->api('/fql?q=SELECT+uid2+FROM+friend+WHERE+uid1=me()');
…or similar queries just don’t work. It returns empty array(s) or freezes my Apache (!). What magic happens inside of the library that such an easy select or it’s results can’t pass through?
EDIT: I know I can use REST API support in PHP SDK as you mention. I was curious about using the new method, because REST API is deprecated and very likely it won’t exist any more in a couple of months. My policy is to use the latest available features Facebook released. Doing so I won’t need to update my code every now and then because of using deprecated features.
EDIT 2: Well, I hope there is no LSD in my room… however, today I opened my browser with all my previous attempts to use different approaches mentioned above and guess what…? It works! Now I can use exactly that piece of code I wrote a few lines higher and it perfectly returns what is expected… Instead of WTF, I say: Facebook Platform.
You can indeed use
FQLthrough theapimethod.try this:
As you can see you must specify that you are running an FQL query, and then pass the FQL statement into the array.
EDIT:
Inside the PHP SDK, you must use the
fql.querymethod, there is no other way of executing an FQL query within the SDK (Yet).