FQL Query for Comment Count Returning Empty Array

Am trying to get this FQL query to return the comment count for a given XID and keep getting an empty Array() when I try to use it.

require “./facebook.php”;

Read More

$facebook = new Facebook(array( ‘appId’ => “MY APP ID”, ‘secret’ =>
“MY SECRET”, ));

$commentCountquery = “SELECT count FROM comments_info WHERE app_id =
‘MY APP ID’ AND xid = ‘DEFAULTXIDSTRING_post<mytestpostID>‘”;

$param = array(
‘method’ => ‘fql.query’,
‘query’ => $commentCountquery,
‘callback’ => ” );

$commentCountresult = $facebook->api($param); print_r(
$commentCountresult );

?>

When I use the Test Console at http://developers.facebook.com/docs/reference/rest/fql.query/ I get an empty set of brackets returned “[]”

I am using the Facebook Comments for WordPress Plugin to deliver these comments to the page in question in the first place. I have double checked their description of how to format the XID (“This plugin takes your XID (which was randomly generated when you activated the plugin) and appends _post”) and have checked it against what’s rendering on the page by cutting and pasting from the source. I understand that this is not how I would do it in a full scale implementation; I am just trying to get a known XID in before complicating it with more PHP to pull the post ID from each page.

Why doesn’t my FQL query return a value?!

I’d like to thank all of those who answered other people’s questions for getting me this far, it’s just this last bit (the “getting it to actually work” bit) eludes me completely.

Related posts

Leave a Reply