下一个生日用fql - facebook

时间:2012-04-29 12:39:20

标签: sql facebook-graph-api facebook-fql

使用Facebook图形API我有以下显示用户朋友的这个月生日

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

我真正希望展示的是接下来的10个生日,所以它可能会在月份接近结束时跨越几个月,但是,facebook确实喜欢现在的查询,所以我有点迷失了我将如何实现这一目标? / p>

1 个答案:

答案 0 :(得分:0)

我明白了 - 这就是你怎么做的!

$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