views:

576

answers:

1

Hello I have implemented the following

$fql    =   "SELECT uid2 FROM friend WHERE uid1=" . $uid;
$param  =   array(
 'method'    => 'fql.query',
 'query'     => $fql,
 'callback'  => ''
);
$fqlResult   =   $facebook->api($param);

Now I need to fetch elements from $fqlResult. How should I do this?

A: 

You can just iterate through the array returned by facebook:

$fqlResult   =   $this->facebook->api($param);
foreach($fqlResult as $result)
{
  print_r($result);
  print($result['name']);
}    

Thanks for the code! I was looking for this way of making FQL's with the new library!

cadragon