title: Facebook Graph API and FQL gives error in PHP
body: <p>I'm trying to run FQL using graph api.</p>
  
  <pre><code>$graph_url = "https://graph.facebook.com/fql?q=".$fql."&amp;access_token=". $access_token;
  
  $output = json_decode(file_get_contents($graph_url));
  
  var_dump($output);
  </code></pre>
  
  <p>This gives an error</p>
  
  <blockquote>
    <p><code>[function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request</code> </p>
  </blockquote>
  
  <p>If i copy and paste the contents of <code>$graph_url</code> in the browser, i get the expected results. So, I'm sure my access_token and fql query are correct.</p>
  
  <p>Also, if i try to fetch the contents by</p>
  
  <pre><code>  $graph_url = "https://graph.facebook.com/me/?access_token=". $access_token;
  
    $output = json_decode(file_get_contents($graph_url));
  
    var_dump($output);
  </code></pre>
  
  <p>I don't get any errors but expected result. I'm not sure, what is missing in my fql query.</p>