FQL:对事件表的查询返回的不是活动场所.id,而是会场名称 [英] FQL: query for event table returns venue.name instead of venue.id

查看:69
本文介绍了FQL:对事件表的查询返回的不是活动场所.id,而是会场名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在进行查询以获取事件详细信息时,我似乎在结果集中获得了event.name而不是event.id.表结构是否发生了未经通知的更改,或者我做错了什么. Graph API Explorer提供了place.id,但是当在我自己的网站上通过PHP SDK通过FQL使用FQL时,它就是我得到的会场名称.

When making a query to get event details I seem to get venue.name instead of venue.id in the result set. Has there been an unannounced change in the table structure or am I doing something wrong. The Graph API Explorer gives the venue.id yet when using FQL through PHP SDK in my own web site it's the venue.name I get.

此处提供代码:

$fql='{
"event_info": "SELECT name,description, pic_small,pic_big, eid,venue,location FROM event WHERE eid ='.$_GET['id'].'", 
"event_venue":"SELECT name, username, page_id, location FROM page WHERE name IN (SELECT venue.id FROM #event_info)"
}';

    $setup  =   array(
    'method'    => 'fql.multiquery',
    'queries'     => $fql,
    'callback'  => ''
    );

    $result   =   $facebook->api($setup);

这将导致"event_venue"结果集为空.

This leads to the "event_venue" result set to be empty.

这是转储:

Array
(    
    [0] => Array
         (
            [name] => event_info
        [fql_result_set] => Array
            (
                [0] => Array
                    (
                        [eid] => 410351692336116
                        [venue] => Array
                            (
                                [name] => Boothill 
                            )

                        [location] => Boothill
                    )

            )

    )

[1] => Array
    (
        [name] => event_venue
        [fql_result_set] => Array
            (
            )

    )

)

推荐答案

如果我测试此查询

SELECT name,description, pic_small,pic_big, eid,venue,location
  FROM event WHERE eid ='410351692336116'

使用Graph API资源管理器中的FQL选项卡(!),我得到

using the FQL tab (!) in the Graph API explorer, I get

"venue": {
  "id": 126049334121592
}

而不是场馆名称.

然后执行与您一样的多查询,第二个查询为

And doing a multiquery like your’s with the second query being

"event_venue":"SELECT name, username, page_id, location FROM page
  WHERE page_id IN (SELECT venue.id FROM #event_info)"

我也正在获取场地信息.

I’m getting the venue info as well.

如果您不使用$ setup数组执行查询,请检查是否得到了不同的结果

Could you please check if you get a different result if you do your queries not using your $setup array with

'method'    => 'fql.multiquery',

但只是

$facebook->api('/fql?q='.urlencode('{ "event_info": "…", "event_venue": "… FROM page
  WHERE page_id IN (SELECT venue.id FROM #event_info)" }'));

相反?

这篇关于FQL:对事件表的查询返回的不是活动场所.id,而是会场名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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