Q:

Fetch FQL data with PHP

*UPDATE
The data was being returned but not being output to the browser. When I looked at the source it was all there after I used the urlencode recommendation in the answer below.**
Pulling my hair out with this one.
Based on the following links:
facebook FQL overview
and FQL Video table info
This code should work to pull the table data I need:
ini_set("display_errors","2");
ERROR_REPORTING(E_ALL);

$contents = file_get_contents('https://api.facebook.com/method/fql.query?query=SELECT vid, owner, title, description, thumbnail_link, embed_html, updated_time, created_time FROM video WHERE owner= *******myID****');

echo $contents;

But I am getting the following error:
Warning: file_get_contents(https://api.facebook.com/method/fql.query?query=SELECT  vid, owner, title, description, thumbnail_link, embed_html, updated_time, created_time FROM video WHERE owner= ******myID*****) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request in /vservers/mywebsite/htdocs/test.php on line 5

Can anyone see what I am doing wrong?

A:

Try changing the main line to:
$enc = urlencode('SELECT vid, owner, title, description, thumbnail_link, embed_html, updated_time, created_time FROM video WHERE owner= *******myID****');
$contents = file_get_contents("https://api.facebook.com/method/fql.query?query=$enc");

