当我尝试选择照片和相册时,fql.query返回空数组

时间:2011-05-13 11:17:09

标签: facebook facebook-fql

$friends = $facebook->api(array('method'=>'fql.query',
                                'query'=>'SELECT src_big, pid, src 
                                            FROM photo 
                                           WHERE owner = "$user_id" '));
print_r($friends)

请告诉我...我希望选择获取照片和相册以及评论,最新更新。

2 个答案:

答案 0 :(得分:1)

要返回您需要的照片,请先选择相册。试试吧:

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

答案 1 :(得分:0)

除上述内容外:还需要照片许可:如果您只有user_photos,则无法查询朋友的照片等。因此请求用户权限:

"user_photos","friends_photos"

如描述 http://developers.facebook.com/docs/reference/api/permissions/