I am trying to find the friends with most mutual friends with me.
public function topThreeMutualFriends() {
$count;
$query='select uid1 from friend where uid1 in (select uid2 from friend where uid1=me()) and uid2 in (Select uid2 from friend where uid1=me()) and uid1!=uid2';
$result = $this->api(array('query' => $query , 'method' => 'fql.query'));
if(!$result)
throw new exception("No Mutual Friends");
else{
foreach ($result as $uid)
$count[$uid['uid1']]++;
arsort($count, SORT_NUMERIC);
$i=0;
foreach($count as $key=>$uid){
$topthree[$i++]=$key;
if($i==3)break;
}
return array($topthree,$count);}
}
In the above code an exception is raised stating:"This API call could not be completed due to resource limits" I tried giving all the permissions, and the query works fine in the fql tester. What could be the possible reason??