开发者

fql.query is returning the empty array when i try to select the photos and albums

开发者 https://www.devze.com 2023-03-05 10:40 出处:网络
$friends = $facebook->api(array(\'method\'=>\'fql.query\', \'query\'=>\'SELECT src_big, pid, src
$friends = $facebook->api(array('method'=>'fql.query',
                                'query'=>'SELECT src_big, pid, src 
                                            FROM photo 
                                          开发者_StackOverflow中文版 WHERE owner = "$user_id" '));
print_r($friends)

Please advise me... I want the select to get the photos and albums and comment, recent updates.


To return the photos you need first to select the albums. Try it:

SELECT src_big, pid, src FROM photo WHERE aid IN (SELECT aid FROM album WHERE owner = "$user_id")


In addition to the above: Permission to photos is also required: if you have only user_photos, you cannot query the friend's photos etc. So request user permissions:

"user_photos","friends_photos"

as described in http://developers.facebook.com/docs/reference/api/permissions/

0

精彩评论

暂无评论...
验证码 换一张
取 消