I've got my 3 queries all set up in my connection and configuration to Facebook. The configuration is correct as I'm getting return values. Here is my queries:
$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
);
What I'm getting returned is the product of the 2nd query and not the 3rd; it seems to totally ignore it. I'm trying to get the information for all of my friends' pages. Instead of retrieving all the names, it prints out the page_id's for each page (from query2). Any idea why it's ignoring the 3rd query?
EDIT:
I've managed to get it working by merging the first and second query together into one larger query. Is there a known limit of 2 queries in FQL multiqueries?
$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);