Facebook Graph API and FQL gives error in PHP
I'm trying to run FQL using graph api.

$graph_url = "https://graph.facebook.com/fql?q=".$fql."&access_token=". $access_token;
				
$output = json_decode(file_get_contents($graph_url));

var_dump($output);

This gives an error  [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request 

If i copy and paste the contents of $graph_url in the browser, i get the expected results. So, I'm sure my access_token and fql query are correct.

Also, if i try to fetch the contents by

   $graph_url = "https://graph.facebook.com/me/?access_token=". $access_token;

   $output = json_decode(file_get_contents($graph_url));

   var_dump($output);

I don't get any errors but expected result. 

I'm not sure, what is missing in my fql query. Please help.

Thank You.


Facebook Graph API and FQL gives error in PHP
===

I'm trying to run FQL using graph api.

$graph_url = "https://graph.facebook.com/fql?q=".$fql."&access_token=". $access_token;
				
$output = json_decode(file_get_contents($graph_url));

var_dump($output);

This gives an error  [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request 

If i copy and paste the contents of $graph_url in the browser, i get the expected results. So, I'm sure my access_token and fql query are correct.

Also, if i try to fetch the contents by

   $graph_url = "https://graph.facebook.com/me/?access_token=". $access_token;

   $output = json_decode(file_get_contents($graph_url));

   var_dump($output);

I don't get any errors but expected result. 

I'm not sure, what is missing in my fql query. Please help.

Thank You.

