FQL returns only one photo

一世执手 提交于 2019-12-11 12:14:10

问题


I use this query:

SELECT pid FROM photo WHERE owner=$friend_id;

It works fine, but for some users(that has more than 1 photo) this query returns only 1 record.

Then i tried this query:

SELECT pid FROM photo WHERE owner=$friend_id LIMIT 10;

But returned result is the same - only 1 record.

Permissions :

user_activities, user_photos, friends_activities,
friends_photos, publish_stream

What i have to do to get correct result for anyone user??


回答1:


This depends on the friend's privacy settings for the albums and photos he/she shares/uploads.

Also, I noticed that the owner field in the photo table is not indexable but it is in the album table and hence you may need to use something like:

SELECT pid FROM photo WHERE owner = XXXXXX AND aid IN (
    SELECT aid FROM album WHERE owner = XXXXXX
)


来源:https://stackoverflow.com/questions/13156984/fql-returns-only-one-photo

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!