Facebook的API和FQL QRY后到我所有的朋友 [英] facebook api and fql qry post to all my friends

查看:265
本文介绍了Facebook的API和FQL QRY后到我所有的朋友的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过应用程序发布的所有好友​​

当我把这个code它带给我一个错误

解析错误:语法错误,意想不到的T_STRING,预计')'在test111.php第19行

谁能帮我?
谢谢

 规定../settings.php
    需要'../src/facebook.php';
    要求../fbaccess.php
    要求web_config.php
    //用户从数据库中的数据
    $ SQL =的mysql_query(SELECT USER_ID,user_access_token,user_access_token_expire FROM data_table);    而($数据= mysql_fetch_array($ SQL)){
    $ USER_ID = $数据['USER_ID'];
    $的accessToken = $数据['user_access_token'];
    $ accessTokenExpire = $数据['user_access_token_expire'];
                $ all_friends = $ facebook-> API(阵列('方法'=>'fql.query','查询'=>'选择UID FROM用户WHERE(UID IN(SELECT UID2从相知WHERE UID1 =我() ));    尝试{
                $ publishStream = $ facebook-> API(/ $ all_friends /饲料,后,阵列(
                    '消息'= GT; 。,
                    '链接'=> '',
                    '图片'=> '',
                    '名'=>的iOS应用和放大器;游戏',
                    '描述'=> 结账iOS应用,并从iThinkdiff.net游戏。我发现其中一些只是真棒!
                    )
                );
                //为$ _GET ['发布']被设定为通过重定向用户的基本URL中移除
            }赶上(FacebookApiException $ E){
                error_log中($ E);
            }
    }
&GT ;?


解决方案

您需要一个或多个在开头的行的末尾 $ all_friends =

您已经在这里还有其他的一些问题。尝试使用PHP语法检查器是这样的: http://www.piliapp.com/php-syntax-检查/

I want to publish All My Friends through apps

When I put this code it brings me an error

Parse error: syntax error, unexpected T_STRING, expecting ')' in test111.php on line 19

Can anyone help me? Thank you

    require "../settings.php";
    require '../src/facebook.php';
    require "../fbaccess.php";
    require "web_config.php";


    //user data from database
    $sql = mysql_query("SELECT user_id,user_access_token,user_access_token_expire FROM data_table");

    while ($data = mysql_fetch_array($sql)){
    $user_id = $data['user_id'];
    $accessToken = $data['user_access_token'];
    $accessTokenExpire = $data['user_access_token_expire'];
                $all_friends = $facebook->api(array('method' => 'fql.query', 'query' => 'SELECT uid FROM user WHERE (uid IN (SELECT uid2 FROM friend WHERE uid1=me()));

    try {
                $publishStream = $facebook->api("/$all_friends/feed", 'post', array(
                    'message' => ".",
                    'link'    => '',
                    'picture' => '',
                    'name'    => 'iOS Apps & Games',
                    'description'=> 'Checkout iOS apps and games from iThinkdiff.net. I found some of them are just awesome!'
                    )
                );
                //as $_GET['publish'] is set so remove it by redirecting user to the base url
            } catch (FacebookApiException $e) {
                error_log($e);
            }
    }
>?

解决方案

You need one more ) at the end of the line that begins $all_friends=

You've got several other problems here. Try a PHP syntax checker like this: http://www.piliapp.com/php-syntax-check/

这篇关于Facebook的API和FQL QRY后到我所有的朋友的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆