try {
$fql = array(
"query1" => "SELECT uid2 FROM friend WHERE uid1 = me()",
"query2" => "SELECT name, url, pic FROM profile WHERE id IN (SELECT uid2 FROM #query1)"
);
//$fql = "SELECT uid2 FROM friend WHERE uid1 = me()";
// Proceed knowing you have a logged in user who's authenticated.
$user_profile = $facebook->api( array(
'method' => 'fql.multiquery',
'queries' => $fql,
) );
} catch ( FacebookApiException $e ) {
error_log( print_r( $e->getMessage(), true ) );
$user = NULL;
}