Hi , I am trying to run a FQL for the first time. This is the code I have included in my index.php file:
<?php $query="SELECT message FROM status WHERE uid = 544337058";echo $query; ?>
<?php
include_once ('facebook.php');
$api_key = 'XXXXXXXXXXXXXXX';
$secret = 'XXXXXXXXXXXXXXXXX';
global $facebook;
$facebook = new Facebook($api_key, $secret);
$result = $facebook->api_client->fql_query($query);
?>
<?php echo $result?>
I have logged into facebook from a different tab and just trying to read my own status message. However I am getting the following error:
SELECT message FROM status WHERE uid = @@@@@@
Fatal error: Uncaught exception 'FacebookRestClientException' with message 'Requires
user session' in /users/home/aafhe7vh/web/public/facebookapi_php5_restlib.php:3065 Stack
trace: #0 /users/home/aafhe7vh/web/public/facebookapi_php5_restlib.php(1025):
FacebookRestClient->call_method('facebook.fql.qu...', Array) #1 /users/home/aafhe7vh
/web/public/status.php(46): FacebookRestClient->fql_query('SELECT message ...') #2 {main}
thrown in /users/home/aafhe7vh/web/public/facebookapi_php5_restlib.php on line 3065
How do I get and provide a user's session to this query.
Thanks.