无法在FaceBook上获取我朋友列表的在线状态

Abd*_*iri 5 php facebook-graph-api

这是我的fql:

$fql = "SELECT uid, name, online_presence, status 
         FROM user 
        WHERE uid IN ( SELECT uid2 FROM friend WHERE uid1 = '".$user_id."') ";
Run Code Online (Sandbox Code Playgroud)

online_presence值总是返回null.

Sum*_*ani 0

您的查询有错误...

只需更换

WHERE uid IN
Run Code Online (Sandbox Code Playgroud)

WHERE 2 IN
Run Code Online (Sandbox Code Playgroud)

询问

$fql = "SELECT uid, name, online_presence, status 
         FROM user 
        WHERE 2 IN ( SELECT uid2 FROM friend WHERE uid1 = '".$user_id."') ";
Run Code Online (Sandbox Code Playgroud)

SQLFiddle 演示