Php graph api没有返回良好的数据,为什么?

Php graph api没有返回良好的数据,为什么?,php,facebook,facebook-graph-api,facebook-javascript-sdk,facebook-fql,Php,Facebook,Facebook Graph Api,Facebook Javascript Sdk,Facebook Fql,我正在使用graph api捕捉相册中照片的喜好、共享和评论。在大多数情况下,它做得很好,但也有少数人喜欢、分享和评论相册,而不是图片。我不知道为什么 我使用php和两个fql: //get all photo ids of one album $user_id= "my user id"; $photo_limit= "my limit"; $album_name="my album name"; $access_token= "my access token"; $fql_query_u

我正在使用graph api捕捉相册中照片的喜好、共享和评论。在大多数情况下,它做得很好,但也有少数人喜欢、分享和评论相册,而不是图片。我不知道为什么

我使用php和两个fql:

//get all photo ids of one album

$user_id= "my user id";
$photo_limit= "my limit";
$album_name="my album name";
$access_token= "my access token";

$fql_query_url = 'https://graph.facebook.com'.
'fql?q=SELECT+object_id+FROM+photo+WHERE+album_object_id+in+
(SELECT+object_id,+name+FROM+album+WHERE+owner+=+'.$user_id.'
+and+name+=+"'.$album_name.'")+limit+'.$photo_limit. '&access_token=' . $access_token;

$fql_query_result = file_get_contents($fql_query_url);
$fql_query_obj = json_decode($fql_query_result, true);



//print the likes, shares, and comments of all photos
foreach ($fql_query_obj["data"] as $photo_id){

$id = $photo_id["object_id"];
$fql_query_url_1 = 'https://graph.facebook.com/'.
'fql?q=SELECT+like_info.like_count,+comment_info.comment_count,+share_count,+
created_time+from+stream+where+post_id+in
(Select+page_story_id+from+photo+where+object_id+=+'.$id.')'.
'&access_token='.$access_token;

$fql_query_result_1 = file_get_contents($fql_query_url_1);
$fql_query_obj_1 = json_decode($fql_query_result_1, true);

echo $fql_query_obj_1["data"][0]["like_info"]["like_count"].",".
$fql_query_obj_1["data"][0]["comment_info"]["comment_count"].",".
$fql_query_obj_1["data"][0]["share_count"]."\n";

}
在某些情况下,循环中的照片返回错误数据。为什么


提前感谢。

“我使用cookbook。有时晚餐味道不好。为什么?”如果没有任何代码或实际有用的细节,我们应该如何提供任何类型的帮助?我建议您不要使用
从照片中选择对象id
,而是
从照片中选择pid
。pid是实际的照片id。我已经更改了pid的对象id,并且发生了相同的情况。