FQL returns only one photo

2019-08-11 05:45发布

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条回答
做自己的国王
2楼-- · 2019-08-11 06:35

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
)
查看更多
登录 后发表回答