如何获取照片的PID?
$pid = $fb->api(array(
'method' => 'fql.query',
'query' => 'SELECT first_name from user where uid='.$session['uid'])
);
try {
$fb->api( array(
'method' => 'photos.addTag',
'pid' => $pid[0],
'tag_uid' => '100000492080016',
'tag_text' => "hello",
'x' => 65,
'y' => 65,
) );
} catch (FacebookApiException $e) {
print_r($e);
}
当我在 Facebook 应用程序中使用上面的代码时,它显示错误
参数 pid 必须是有效的合并照片 id。
我该如何解决这个问题?或者你能解释一下如何以其他方式检索图片的 PID 吗?
$pid = $fb->api(array(
'method' => 'fql.query',
'query' => 'SELECT first_name from user where uid='.$session['uid'])
);
try {
$fb->api( array(
'method' => 'photos.addTag',
'pid' => $pid[0],
'tag_uid' => '100000492080016',
'tag_text' => "hello",
'x' => 65,
'y' => 65,
) );
} catch (FacebookApiException $e) {
print_r($e);
}
When i use the above code in a facebook app, it shows the error
Param pid must be a valid merged photo
id.
How can i resolve this problem? Or can you explain how to retrieve the PID of a pic in any other way?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在您的查询中,您只从数据库中检索
first_name from user where uid='.$session['uid']
,这就是我认为的问题。所以我认为你需要改变你的查询。
我对 Facebook API 不太熟悉,但可能是真的。
谢谢。
In your query
SELECT first_name from user where uid='.$session['uid']
you are retriving onlyfirst_name
from database, thats the problem i think.so i think you need to change your query.
I am not as much familiar with Facebook APIs and all but might be i m true.
Thanks.