Question

This is my first day trying out FQL with PHP. I tried the following code to retrieve conversation details of user. I was successful to print out the message along with the sender ID. Where as i wish to print the username along with userid.

$fql = array( 
    "query1"=>"select thread_id,body,author_id from message where thread_id in (select thread_id from thread where folder_id=0 and viewer_id = me() LIMIT 3) LIMIT 50",
    "query2"=>"SELECT uid, name, username, pic_square, current_location, profile_url FROM user WHERE uid IN (SELECT author_id FROM #query1)"
);
$user_profile = $facebook->api( array(
    'method' => 'fql.multiquery',
    'queries' => $fql,
) );
//$msg = $user_profile[0]['fql_result_set'];
//$user = $user_profile[1]['fql_result_set'];    
echo '<pre>';
 print_r($user_profile);
echo '</pre>';

The above $user_profile variable holds a JSON string having 2 indexes [1 for msg and other for user detail]. How to print the message body along with username instead of userid

No correct solution

OTHER TIPS

you can use either print_r or echo, but i tried this, and returns no data, and this is why you are no getting any output

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top