fql users friends likes certain page

Find out if a certain users friends likes a certain array of facebook pages.

$user_id=$user_profile['id'];

$query = "SELECT uid, page_id FROM page_fan WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = $user_id) and page_id IN (177367302324350, 349530678432432, 42168616288, 108174445870529, 173587329354820, 60972098632)";

try { 
	$result = $facebook->api(array(
		'method' => 'fql.query',
		'query' => $query,
	));
} catch (FacebookApiException $e) {
	error_log($e);
	$result = 'none';
}