views:

99

answers:

1

I can login but the script below is not printing my status. What can I do to make it work?

require_once 'facebook.php';
$facebook = new Facebook($appapikey, $appsecret);
?>
<script src="http://static.ak.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script>
<script type="text/javascript">
    FB.init('<?php echo $appapikey; ?>', "xd_receiver.htm");
</script>

<?php
if(!$facebook->get_loggedin_user())
{
    ?>
        <fb:login-button size="large" length="long"></fb:login-button>
    <?php
}
else
{
    //Gets my user id - 1594711371.
    $user = $facebook->api_client->user;
    $status= $facebook->api_client->fql_query("SELECT status FROM user WHERE uid =".$user."");
    echo "<pre>";
    print_r($status);
    echo "</pre>";
}
A: 

Try $user['uid'] or maybe $user->uid:

$status= $facebook->api_client->fql_query("SELECT status FROM user WHERE uid =".$user['uid']."");
apphacker
It is priting my userid when echoed the $user variable. So i dont think your suggestion does make a difference.
anthony
i just made test, thats not working :(
anthony