我已经在与 Facebook 的连接和配置中设置了 3 个查询。配置是正确的,因为我正在获取返回值。这是我的查询:
$fql_friends_fan_pages = array(
'query1' => "SELECT uid2 FROM friend WHERE uid1 = me()", //get all me()'s friends
'query2' => "SELECT page_id FROM page_fan WHERE uid IN (SELECT uid2 FROM #query1)", //get all fan page references from friends
'query3' => "SELECT name FROM page WHERE page_id IN (SELECT page_id FROM #query2)" //get all info from friends' fan pages
);
我得到的是第二个查询的产品,而不是第三个;它似乎完全忽略了它。我正在尝试获取我所有朋友页面的信息。它不是检索所有名称,而是打印出每个页面的 page_id(来自 query2)。知道为什么它忽略了第三个查询吗?
编辑:
我设法通过将第一个和第二个查询合并到一个更大的查询中来使其工作。FQL 多查询中是否存在 2 个查询的已知限制?
$fql_friends_fan_pages = array(
'query1' => "SELECT uid2 FROM friend WHERE uid1 = me()", //get all me()'s friends
'query2' => "SELECT page_id FROM page_fan WHERE uid IN (SELECT uid2 FROM #query1)", //get all fan page references from friends
'query3' => "SELECT name FROM page WHERE page_id IN (SELECT page_id FROM #query2)" //get all info from friends' fan pages
);
$params_friends_fan_pages = array(
'method' => 'fql.multiquery',
'queries' => $fql_friends_fan_pages
);
$friends_fan_pages = $facebook->api($params_friends_fan_pages);