PHP致命错误:在第292行的/home/elankeer/public_html/hiddenfriend/index.php中调用非对象上的成员函数fql_query()

时间:2010-08-28 20:12:17

标签: facebook

我正在使用从http://github.com/facebook/php-sdk

下载的facebook.php

代码

$fql = 'SELECT uid FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1='.$user.') AND has_added_app = 1';
$_friends = $facebook->api_client->fql_query($fql);

抛出错误如下

  

PHP致命错误:致电会员   函数fql_query()在非对象上   在   /home/elankeer/public_html/friend/index.php   在第292行

请帮助我!!

1 个答案:

答案 0 :(得分:4)

在新的facebook api sdk中,我们需要执行以下代码

$_friends = $facebook->api(array( 'method' => 'fql.query', 'query' => 'SELECT uid FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1='.$uid.') AND has_added_app = 1', ));

http://forum.developers.facebook.net/viewtopic.php?pid=223391