Facebook FQL 错误
SELECT eid, start_time, name FROM event WHERE (eid IN (SELECT eid FROM event_member WHERE (uid = me() AND start_time < 1317006752)))
此 FQL 查询应该返回 1317006752
之前开始的事件,
但是,除此之外,它还返回有效事件。
{
"eid": 239526399426862,
"start_time": 1317448800,
"name": "Nick Grimshaw, The 2 Bears, S.C.U.M. & more! Friday 30th Sept, Only £4.50"
}
如果我错了,请纠正我,但 1317448800
更大比1317006752
。
SELECT eid, start_time, name FROM event WHERE (eid IN (SELECT eid FROM event_member WHERE (uid = me() AND start_time < 1317006752)))
This FQL query is supposed to return events that began before 1317006752
However, it returns valid events IN ADDITION to this one
{
"eid": 239526399426862,
"start_time": 1317448800,
"name": "Nick Grimshaw, The 2 Bears, S.C.U.M. & more! Friday 30th Sept, Only £4.50"
}
Now correct me if I'm wrong, but 1317448800
is bigger than 1317006752
.
You might be able to verify this by going to the event page, click on something (i.e not attend), then run the query here
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我认为您的问题可能是事件创建者和活动用户之间的时区差异。 Facebook 提供此通知:
I think your issue might be the difference in timezone between the event creator and the active user. Facebook provides this notice:
显然,event_member 中的 start_time 纯粹用于加速对 event_member 表的查询,该表可以返回许多结果。当事件的 start_time 更新时,它似乎没有更新。您的查询应该类似于以下内容才能正常工作,请注意差异:
但我同意这是一个错误。
Apparently start_time in event_member is used purely to speed up queries on event_member table which can return many results. Seems like it is not updated when the event's start_time is updated. Your query should be like the following to work properly, note the difference:
I agree this is a bug though.
我今天在获取即将举行的活动时遇到了这个问题:
正确的 FQL 应该是
编辑
获取此查询的结果是通过以下方式完成的:
重要的是,将 JSON_BIGINT_AS_STRING 选项添加到 json_decode 以防止 eid 成为缩短的浮点表示形式
编辑 2:
由于 const JSON_BIG... 仅可从 php5.4.X+ 获取:
来源: http://www.pixelastic.com/blog/321:fix-floating-issue-json-decode-php-5-3
I had this problem today getting upcoming events :
The correct FQL should be
EDIT
Fetching the result of this query is done by :
Important to add the JSON_BIGINT_AS_STRING option to the json_decode to prevent the eid of becoming a shortend float representation
EDIT 2:
As the const JSON_BIG... is only available from php5.4.X+ :
source : http://www.pixelastic.com/blog/321:fix-floating-issue-json-decode-php-5-3