PHP & MySQL | Tutorials

David Carr

MySQL get users birthday

Here's a simple way to select all birthdays for the current date, where the date of birth is stored in a MySQL database in a DATE format, in this examples a column called 'dob' is used.

SELECT username FROM users WHERE MONTH(dob) = MONTH(NOW()) AND DAY(dob) = DAY(NOW())

This will select all users that have a date of birth matching the current month and day the year is ignored.

Domains are often purchased from multiple providers, keeping track of where a domain is and its DNS settings can be tricky. Domain Mapper solves this by listing all your domains in one place. View your DNS settings and receive reminders to renew your domains. Try it today.

Support my work by donating with PayPal.

Subscribe to my newsletter

Subscribe and get my books and product announcements.

© 2009 - 2021 DC Blog. All code MIT license. All rights reserved.