打印fql multiquery结果

时间:2014-01-07 18:05:32

标签: php facebook facebook-fql fql.multiquery

这是我用PHP试用FQL的第一天。我尝试了以下代码来检索用户的会话详细信息。我成功打印出了邮件以及发件人ID。我希望在哪里打印用户名和用户ID。

$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>';

上面的$ user_profile变量包含一个包含2个索引的JSON字符串[1表示msg,其他表示用户详细信息]。如何打印邮件正文以及用户名而不是用户ID

1 个答案:

答案 0 :(得分:0)

你可以使用print_r或echo,但我试过这个,并且没有返回数据,这就是你没有得到任何输出的原因