获取用户好友的一些数据 - Facebook / FQL
我正在创建一个应用程序,用户可以选择他的一些朋友,然后该应用程序将对所选朋友执行一些操作。
我的问题是 =->
我可以直接写这个FQL吗?
SELECT uid, name, pic_square FROM user WHERE uid = $friendUID
或者我需要写这样的东西吗?
SELECT uid, name, pic_square FROM user
WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) and UID = $friendUID
I'm creating an app where user will be able to select some of his friends then the app will do some job on the selected friends.
My question is =->
Can I directly write this FQL?
SELECT uid, name, pic_square FROM user WHERE uid = $friendUID
Or Do I need to write something like this?
SELECT uid, name, pic_square FROM user
WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) and UID = $friendUID
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
http://developers.facebook.com/docs/reference/rest/fql。 query/
表明两者都是正确的
http://developers.facebook.com/docs/reference/rest/fql.query/
it showed that both are correct
两个查询都是相同的。
在第一个查询中,您直接通过好友 ID 直接访问数据。
在第二个查询中,您正在检查 uid 是否也是朋友,然后访问数据。
您可以使用第一个查询来检查任何用户的数据,尽管他/她可能不是您的朋友。对于 uid、name、pic_square,不要求用户是您的朋友或应用程序用户。您可以获得任何 Facebook 用户的信息。
Both queries are same.
In 1st query, you are directly accessing data by directly Friends Id.
In 2nd query, you are checking uid is also friend or not and then accessing data.
You can use 1st query to check any user's data though he/she might not be your friend. For uid, name, pic_square there is no any requirement that user is your friend or app user. You can get that information of any Facebook user.