Next birthdays with fql - fbook

天大地大妈咪最大 提交于 2019-12-11 18:53:06

问题


Using Facebook graph API I have the following which shows this months birthdays of a users friends

SELECT uid, name,pic_square, birthday_date FROM user
WHERE (substr(birthday_date, 0, 2) = "04") AND uid IN
(SELECT uid2 FROM friend WHERE uid1 = me()) order by name

What I actually want to show is the next 10 birthdays, so it crosses months probably as month is close to end, but, facebook does like the NOW in queries so I'm a little lost how I would achieve this?


回答1:


I figured it out - here's how ya do it!

$dd = date(d);

$mm = date(m);

SELECT uid, name,pic_square, birthday_date FROM user
WHERE (((substr(birthday_date, 0, 2) = "$mm") AND 
(substr(birthday_date, 3, 2) > "$dd") OR (substr(birthday_date, 0, 2) > "$mm")))
AND uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) order by birthday_date asc


来源:https://stackoverflow.com/questions/10372190/next-birthdays-with-fql-fbook

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!