Why can't I return a fql query like this? There seems to be tons of different ways and none of them work, each one returns a different error?
require_once("facebook.php");
$config = array();
$config[‘appId’] = 'XXXXXXXX';
$config[‘secret’] = 'XXXXXXXXXXXXXXXXXXXX';
$facebook = new Facebook($config);
$user=json_decode(file_get_contents('https://graph.facebook.com/me/friends?access_token='.$cookie['access_token']));
foreach($user[data] as $friend){
$fql="select name from user where uid =".$friend['id'];
$param=array('method' => 'fql.query','query' => $fql,'callback' => '');
$fqlResult=$facebook->api($param);
}
print_r($fqlResult);
This way gives this error:
Fatal error: Cannot use object of type stdClass as array in /home/rig/public_html/FB/Q.php on line 13