FQL只返回一张照片 [英] FQL returns only one photo

查看:67
本文介绍了FQL只返回一张照片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用以下查询:

SELECT pid FROM photo WHERE owner=$friend_id;

它工作正常,但对于某些用户(具有多于1张照片),此查询仅返回1条记录.

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;

但是返回的结果是相同的-只有1条记录.

But returned result is the same - only 1 record.

权限:

user_activities, user_photos, friends_activities,
friends_photos, publish_stream

user_activities, user_photos, friends_activities,
friends_photos, publish_stream

我该怎么做才能为任何用户获得正确的结果?

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

推荐答案

这取决于朋友对他/她共享/上传的相册和照片的隐私设置.

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

此外,我注意到photo表中的owner字段不可索引,但它在album表中,因此您可能需要使用类似以下内容:

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
)

这篇关于FQL只返回一张照片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆