如何查看用户创建的群组总数
我正在使用这些代码,但它失败了:
$fql = "SELECT name FROM group WHERE gid IN (SELECT name FROM group WHERE version=1) AND creator=me()";
$ret_obj = $facebook->api(array(
'method' => 'fql.query',
'query' => $fql,
));
echo count($ret_obj["name"]);
有谁知道如何 count() 编号。一个人创建的组的数量。谢谢 我正在使用 PHP-SDK。
i'm playing with these code and it fails:
$fql = "SELECT name FROM group WHERE gid IN (SELECT name FROM group WHERE version=1) AND creator=me()";
$ret_obj = $facebook->api(array(
'method' => 'fql.query',
'query' => $fql,
));
echo count($ret_obj["name"]);
does anyone knows how to count() the no. of groups a person has created. Thanks
i'm using PHP-SDK.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
似乎组表只有 1 个字段 gid 可索引,这使得无法在 FQL 中过滤用户组。可能的错误。
您可以做的是进行图形 API 调用:
然后按 Owner.id 过滤结果并对其进行计数。
希望这有帮助
Seems like group table has only 1 field gid as indexable which makes it impossible to filter user groups in FQL. Possible bug.
What you can do is make a graph API call to:
and then filter results by owner.id and count them.
hope this helps