I cannot figure out what is wrong with this fql.multiquery and cannot seem to find any examples of the new sdk with fql.multiquery.
Ultimately I want to get the page name and page id(s) of the visiting user pages which they both administrator and are fans of.
$queries = '{
"page_admin_ids" : "SELECT page_id FROM page_admin WHERE uid = ' . $afid . ' LIMIT 5",
"page_fan_ids" : "SELECT page_id FROM page_fan WHE开发者_开发问答RE page_id IN (SELECT page_id FROM #page_admin_ids)",
"page_name_and_id" : "SELECT name, page_id FROM page WHERE page_id IN (SELECT page_id FROM #page_fan_ids)"
}';
$attachment = array("method"=>"fql.multiquery","query"=>$queries,'access_token'=>$access_token);
$ret_code = $facebook->api($attachment);
print_r($ret_code); die();
$multiQuery = array(
'likes' =>
' SELECT ... FROM like ...',
'users' =>
' SELECT uid, name ' .
' FROM user ' .
' WHERE uid IN (SELECT user_id FROM #likes) ',
);
$multiQueryResult = $facebook->api(array(
'method' => 'fql.multiquery',
'queries' => $multiQuery
));
I think you should replace "query" parameter in $attachment with "queries".
精彩评论