List:General Discussion« Previous MessageNext Message »
From:ESV Media GmbH Date:May 8 2006 1:23pm
Subject:[Fwd: Getting next birthdays]
View as plain text  
Hey, i´ve a problem with getting the next and the actual birthdays.

This my actual birthday sql :

SELECT SQL_CACHE birthday,mem.lname, mem.fname,mem.mem_id FROM members mem
INNER JOIN network net ON (net.mem_id = mem.mem_id AND net.frd_id =1)
WHERE
(( DAYOFYEAR(FROM_UNIXTIME( mem.birthday )) < DAYOFYEAR(now()) 
)*DAYOFYEAR(CONCAT(YEAR(NOW()),'-12-31')))+DAYOFYEAR(FROM_UNIXTIME( 
mem.birthday )) >= DAYOFYEAR(now())
ORDER BY (( DAYOFYEAR(FROM_UNIXTIME( mem.birthday ))<DAYOFYEAR(NOW()) 
)*DAYOFYEAR(CONCAT(YEAR(NOW()),'-12-31')))+DAYOFYEAR(FROM_UNIXTIME( 
mem.birthday )) LIMIT 4

The field birthday is in a Unix timestamp format.
I need the birthdays from yesterday, today and the next 4 or 5 birthdays.
And i need the table network to get my friends list.


Thread
[Fwd: Getting next birthdays]ESV Media GmbH8 May
  • Re: [Fwd: Getting next birthdays]Peter Brawley8 May