当我运行此代码有时它可以工作,而其他时候它不会并给出此异常异常:1:发生未知错误
这是代码
$user_access_token= $rowsUser['access_token'];
$user= $rowsUser['userId'];
$email= $rowsUser['email'];
$facebook = new Facebook(array(
'appId' => APP_ID,
'secret' => APP_SECRET,
'cookie' => true,
));
$access_token=$facebook->setAccessToken($user_access_token);
try{
$fql = 'SELECT relationship_status,website,contact_email,work,education,
current_location,uid, name,birthday_date,sex,email, profile_url
FROM user
WHERE uid IN (SELECT uid2 FROM friend WHERE uid1='.$user.')';
$param = array(
'method' => 'fql.query',
'query' => $fql,
'callback' => ''
);
$_friends = $facebook->api($param);
print_r($_friends);
}catch(Exception $ex){
echo $ex;
}
任何帮助将不胜感激。