我已经在我与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);