fql.multiquery 返回空数组
我正在尝试查询页面的所有相册并获取每个相册的封面照片。下面是我返回空结果的代码。
我可以分别进行这两个查询而不会出现问题,因此这不是权限问题。
$album_fql = "SELECT aid, owner, name, object_id, cover_pid, cover_object_id
FROM album
WHERE owner = 'xxxxxxx'";
$albumpic_fql = "SELECT pid, src_small
FROM photo
WHERE pid IN (SELECT cover_pid FROM #query1)";
$album_param = array(
'method' => 'fql.multiquery',
'queries' => '{"query1":"' . $album_fql . '", "query2":"' . $albumpic_fql . '"}');
$album_fqlResult = $facebook->api($album_param);
print_r($album_fqlResult);
有什么想法吗?
I'm am trying to query all the photo albums of a page and get each albums cover photo. Below is the code I have that returns an empty result.
I am able to make both the queries separately without the problem, so it is not a permissions issue.
$album_fql = "SELECT aid, owner, name, object_id, cover_pid, cover_object_id
FROM album
WHERE owner = 'xxxxxxx'";
$albumpic_fql = "SELECT pid, src_small
FROM photo
WHERE pid IN (SELECT cover_pid FROM #query1)";
$album_param = array(
'method' => 'fql.multiquery',
'queries' => '{"query1":"' . $album_fql . '", "query2":"' . $albumpic_fql . '"}');
$album_fqlResult = $facebook->api($album_param);
print_r($album_fqlResult);
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以在嵌套查询中而不是作为多重查询来执行此操作。
例如,这是我从可口可乐 Facebook 页面返回的专辑封面列表
:
如果您想尝试多重查询,则尝试从索引 0 而不是 1 开始命名查询。例如 query0 和 query1 这是 C# SDK 的唯一方法允许,也许 php SDK 也需要这样做。
you can do that in a nested query rather than as a multi query.
for example here's the list of album covers I got from CocaCola's Facebook page
returned:
If you want to try your multiquery, then try to name the queries starting at index 0 instead of 1. e.g. query0 and query1 This is the only way the C# SDK allows it, maybe the php SDK requires that too.
终于想通了。我必须将查询合并到 1 个变量中并转义单引号。
Finally figured it out. I had to merge the queries into 1 variable and escape the single quotes.