如何使用fql查询

发布于 2024-09-27 01:32:58 字数 112 浏览 5 评论 0原文

我是 facebook 应用程序开发的新手,我想知道 fql 查询是如何工作的,我在我的应用程序中使用了它,但我想知道 fql 查询结果显示在哪里,或者如果您无法解释,请向我发送链接,因为官方文档也没有帮助我。

i am new at facebook application development i want to know how fql query works i used it in my application but i want to know where fql query results are displayed or how they can be displayed if you can't explain plz send me the link because the official documentation didn't helped me either.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

被翻牌 2024-10-04 01:32:58
  1. 使用 PHP SDK 连接到 FB。 (可在此处获取)
ini_set('display_errors',1);
错误报告(E_ALL);
require_once 'library/facebook/src/facebook.php';
  1. 检查用户是否已登录FB
$facebook = 新 Facebook(数组(
'应用程序ID' => '您的 API ID',    
'秘密' => “您的应用程序秘密”,   
'cookie'=> true, // 启用可选的 cookie 支持
));
  1. FQL

    <前><代码>尝试{
    $me = $facebook->api('/me');

    $当前页=1;
    $当前帖子=1;
    $当前日期=“”;

    $列表=“”;
    $arrDate=数组();

    $fql = "这里是您的 FQL 声明";
    $参数=数组(
    '方法' => 'fql.query',
    '查询' => $fql,
    '回调' => ”
    );
    $fqlResult = $facebook->api($param);//这里有你的 FQL 结果集

    foreach($fqlResult as $row){
    //对结果做一些事情

    }

    } catch (FacebookApiException $e) {
    错误日志($e);
    }

  1. Connect to FB using the PHP SDK. (available here)
ini_set('display_errors',1);
error_reporting(E_ALL);
require_once 'library/facebook/src/facebook.php';
  1. Check if the user has logged in to FB
$facebook = new Facebook(array(
'appId'  => 'YOUR API ID',    
'secret' => 'YOUR APP SECRET',   
'cookie' => true, // enable optional cookie support
));
  1. FQL

    try {
          $me = $facebook->api('/me');
    
          $currentPage=1;
          $currentPost=1;
          $currentDate="";
    
          $list="";
          $arrDate=array();
    
          $fql    =   "YOUR FQL STATEMENT HERE";
          $param  =   array(
             'method'    => 'fql.query',
             'query'     => $fql,
             'callback'  => ''
          );
          $fqlResult   =   $facebook->api($param);//Here you have your FQL result set
    
          foreach($fqlResult as $row){
          //Do something to the result
    
          }
    
        } catch (FacebookApiException $e) {
          error_log($e);
        }
    
狂之美人 2024-10-04 01:32:58

您可以使用 Facebook Graph Explorer
https://developers.facebook.com/tools/explorer
然后在访问令牌字段下选择“FQL 查询”。
现在您可以尝试 FQL 查询并查看结果。

You can use the Facebook Graph Explorer
https://developers.facebook.com/tools/explorer
And select under the Access token field, "FQL query".
Now you can try FQL queries and see the result of them.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文