Get Upcoming Birthdays Mysql and PHP

Beessyassucky

New Member
I've been trying to get upcoming birthdays using mysql statement and php. Problem is i've seen some solutions but they use date fields. Unfortunately mine is stored as timestamps. The code below only yields results if the birthdate is after 1970. How can I get a query that will give me current month, next month, month after and so on of upcoming birthdays? And how can I get it to ignore the year as well?\[code\] $sql_query = " SELECT mem_id, DATE_FORMAT(FROM_UNIXTIME( birthdate ),'%d/%m/%Y') ) FROM profiles WHERE IF ( MONTH( NOW() ) < 12, MONTH( DATE_FORMAT(FROM_UNIXTIME( birthdate ),'%Y%m%d') ) = MONTH( NOW() ) + 1, MONTH( DATE_FORMAT(FROM_UNIXTIME( birthdate ),'%Y%m%d') ) = 1) ORDER BY birthdate";\[/code\]
 
Back
Top