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! Quote 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') Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/131373-solved-find-birthdays/#findComment-682561 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.