开发者

FQL query error geting events from a fan page

I'm trying to get all events created by a fan page. I used the query below.

SELECT eid, name, description, pic_big, start_time, end_time, location 
FROM event 
WHERE creator = 142258389139112 
      AND eid IN (SELECT eid FROM event_member WHERE uid = 142258389139112)

OK, this works fine, but I see in the FQL documentation that if I do not specify the start_time in table event_member it will just return the future events, but I need ALL events created by the fan page, and this includes when the event is in the past.

I try to use this query:

SELECT eid, name, description, pic_big, start_time, end_time, location 
FROM event 
WHERE creator = 142258389139112 
      AND eid IN (
          SELECT eid 
          FROM event_member 
          WHERE uid = 142258389139112 
                AND start_time > 1316649600 
          ORDER BY start_time
      )

But it returns this error:

"error_code": 604, "error_msg": "Cannot query by both 'eid' and 'start_time'",

When I try to use my uid, this query the function normally:

SELECT eid, name, description, pic_big, start_time, end_time, location 
FROM ev开发者_JS百科ent 
WHERE creator = 142258389139112 
      AND eid IN (
          SELECT eid 
          FROM event_member 
          WHERE uid = me() 
                AND start_time > 1316649600 
          ORDER BY start_time
      )


You have a small syntax error, see the working query below.

SELECT eid, name, description, pic_big, start_time, end_time, location 
FROM event
WHERE creator = 142258389139112 
AND eid IN (SELECT eid FROM event_member WHERE uid = 142258389139112)
AND start_time > 1316649600
ORDER BY start_time

I hope this helps.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜