问题
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