jaymc Posted November 4, 2008 Share Posted November 4, 2008 I have a birthdate field in my database which is stored as a unix timestamp Whats the best way in mysql to pull out all birthdays within the next 7 days Thanks! Link to comment https://forums.phpfreaks.com/topic/131373-solved-find-birthdays/ Share on other sites More sharing options...
Barand Posted November 4, 2008 Share Posted November 4, 2008 SELECT * FROM `data` WHERE DATE_FORMAT(FROM_UNIXTIME(birthdate),'%m%d') BETWEEN DATE_FORMAT(CURDATE(),'%m%d') AND DATE_FORMAT(CURDATE()+INTERVAL 7 DAY,'%m%d') Link to comment https://forums.phpfreaks.com/topic/131373-solved-find-birthdays/#findComment-682500 Share on other sites More sharing options...
jaymc Posted November 5, 2008 Author Share Posted November 5, 2008 Perfect Thank you. Link to comment https://forums.phpfreaks.com/topic/131373-solved-find-birthdays/#findComment-682561 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.