Results 1 to 7 of 7
Thread: Show Next Birthday - PHP & MySQL
May 31, 2004, 15:14 #1
- Join Date
- Jun 2001
- Harlow, Essex, UK
- 0 Post(s)
- 0 Thread(s)
Show Next Birthday - PHP & MySQL
My site contains a database of a group of friends, all with profiles and their date of birth entered. I need a query to show when the next birthday & the date it is, also how old they will be.
Next Birthday: Ian Gunter will be 28 on the 11th July
I have come up with thisCode:
SELECT id, name_f, name_l, DATE_FORMAT(d_o_b,'%m %D') AS d_o_b2 FROM users WHERE d_o_b <=CURDATE() ORDER BY d_o_b2 ASC LIMIT 0,1
I also can't figure out ho to use the year to work out how old they will be.
Last edited by spoondevil; May 31, 2004 at 16:04.