views:

446

answers:

2

I want to get my friends picture and their last status message with time.

message,time FROM status

pic_square FROM user

    $status = $facebook->api_client->fql_query("SELECT message,time FROM 
status WHERE uid in (SELECT uid2 FROM friend WHERE uid1=".$user.")");

    echo "<pre>";
    print_r($status);
    echo "</pre>";

above query returns all statuses, i just want only last status message. Also, how can i modify this query to get pic_square from user table.

Thanks in advance,

A: 

FQL accepts MySQL-style "ORDER BY" and "LIMIT" clauses. Order by time, and limit to one result.

ceejayoz
Can you show me the query for the above need?
anthony
A: 

status.get is much better for this purpose: http://wiki.developers.facebook.com/index.php/Status.get

dusoft
Thanks, but i need to make it work with fql
anthony
status.get returns only one user's statuses, i need all of my friends last updated status at one shot
anthony