Home >Database >Mysql Tutorial >How to Use MySQL to Find Users with Birthdays on a Given Date?
Using MySQL to Find Birthdays on a Specific Date
You have a database table containing user information, including their birthdays stored as UNIX timestamps. To automate birthday email notifications, you need a MySQL query that identifies users whose birthdays fall on the current day.
To achieve this, you can use the following query:
SELECT * FROM USERS WHERE DATE_FORMAT(FROM_UNIXTIME(birthDate),'%m-%d') = DATE_FORMAT(NOW(),'%m-%d')
Explanation:
The above is the detailed content of How to Use MySQL to Find Users with Birthdays on a Given Date?. For more information, please follow other related articles on the PHP Chinese website!