I'm trying to check if the user likes the page or not with the following PHP and FQL code:
<?PHP
include 'facebook.php';
$facebook = new Facebook(array(
'appId' => 'my_app_ID',
'secret' => 'my_App_secrert',
));
$user =$facebook->getuser();
$page_id= "200279160150349";
$result = $facebook->api(array(
"method" => "fql.query",
"query" => "SELECT uid FROM page_fan WHERE uid=$user AND page_id=$page_id"
));
if(count($result))
{
echo "is a fan!";
}
else
{
echo "Not Fan";
}
?>
Determine that the user is authorized in another page
But always print Not Fan :(