从用户选定的 10 个好友中选择 uid、性别和头像

发布于 2024-12-10 08:14:52 字数 705 浏览 0 评论 0原文

可能的重复:
如何从我已有的用户 ID 中获取 pic_squre 和性别

我想从 10 个选定的好友中选择 uid、sex、pic square一个用户的。

这 10 个朋友是由用户选择的,我可以将他们的 uid 存储在 PHP 数组中,说

$xyz[]

那么我如何使用该数组来获取这 10 个朋友的 uid、性别和图片方块 FQL

如果使用 FQL 无法做到这一点,我如何使用其他方法来做到这一点?

我尝试过

$FQLQuery = 'SELECT uid,sex,pic_square FROM friend WHERE uid in (" . implode(",", $xyz) . ");';

但这不起作用。我该如何修复它?

Possible Duplicate:
How can I get pic_squre and sex from user id's I already have

I want to select uid, sex, pic square from the 10 selected friends of a user.

And those 10 friends are selected by the user, and I can store their uid in a PHP array, say

$xyz[]

So how can I use that array to get the uid, sex, and pic square of those 10 friends by FQL?

And if this is not possible with FQL, how I can do it with other methods?

I tried this

$FQLQuery = 'SELECT uid,sex,pic_square FROM friend WHERE uid in (" . implode(",", $xyz) . ");';

But this is not working. How can I fix it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

想挽留 2024-12-17 08:14:52

只需将“朋友”替换为“用户”

$FQLQuery = 'SELECT uid,sex,pic_square FROM user WHERE uid in (" . implode(",", $xyz) . ");'

Just replace "friend" with "user"

$FQLQuery = 'SELECT uid,sex,pic_square FROM user WHERE uid in (" . implode(",", $xyz) . ");'
可爱暴击 2024-12-17 08:14:52

请参阅https://developers.facebook.com/docs/reference/rest/fql.query/。您可以在此处执行 FQL 查询。

因此 friend 表 只有两列:uid1、uid2,如 https://developers.facebook.com/docs/reference/fql/friend/ 中所述

最后您的查询应该是:

SELECT uid, sex,pic_square FROM user WHERE uid in(  select uid2 from friend where uid1=786644124)

See https://developers.facebook.com/docs/reference/rest/fql.query/. You can execute FQL queries here.

So friend table has only two columns: uid1, uid2 as stated in https://developers.facebook.com/docs/reference/fql/friend/

Finally your query should be:

SELECT uid, sex,pic_square FROM user WHERE uid in(  select uid2 from friend where uid1=786644124)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文