FQL下一个生日-FBook [英] Next birthdays with fql - fbook

查看:79
本文介绍了FQL下一个生日-FBook的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Facebook graph API,我有以下内容显示了这个月的用户朋友生日

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

我实际上想显示的是接下来的10个生日,所以跨月大概是几个月,因为一个月快结束了,但是Facebook确实喜欢查询中的NOW,所以我有点不知道该如何实现呢? /p>

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?

推荐答案

我知道了-这是您的操作方式!

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

这篇关于FQL下一个生日-FBook的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆