开发者

facebook fql returning album id's with an underscore

i have this fql statement

$fql_query  =   array(
 'method' => 'fql.query',
 'query' => 'SELECT aid, owner, name from album WHERE owner = ' . $uid
);
$albums = $facebook->api($fql_query);

the print_r dump of the return contains aid= matching the id of the owner rather than the id of the actual album. but the aid is return not only with the user id but with extra info tagged on to the end like "43367" for one album and another album has "-3开发者_高级运维" tagged on to it

2 questions then

  1. why is the owner id being returned instead of the correct album id
  2. and whats being tagged on to the end of it?


If you look at album table docs it says that returned aid is unique for every user and is a string. So the value you receive is "correct" in a sense that you can use it for this particular user wherever you need album id.

Maybe you are interested in object_id field instead?


you need to wrap the aid in quotes when running this query, because it is a string. So it would look like this:

query=SELECT pid FROM photo WHERE aid = '[OWNERID_ALBUMID]'&access_token=[token]


In FQL, the object_id in album is the same as the id you get when using the graph API. So, use object_id instead of aid.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜