Question

How can I get the list of upcoming b'days of my friends with user id, name and birth day. I am using following fql query to get the friends b'day list.

  query = "SELECT uid, name, birthday_date FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1=me()) ORDER BY birthday_date DESC LIMIT 50 ";
Was it helpful?

Solution

Change your FQL query to :

SELECT uid, name, birthday_date FROM user
WHERE uid IN (SELECT uid2 FROM friend WHERE uid1=me())
AND birthday_date >= "06/08"
AND birthday_date <= "06/15"
ORDER BY birthday_date ASC

This will constraint the date to the next week, ordered by the next available birthday.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top