I have a database where users stores their birthday. y-m-d, and I'm trying to get every user that has the same birthday; the year can be different between each user.
So how do I turn this to a working script:
SELECT username FROM table_name WHERE birthday='$birthday'
$birthday
gets its data from a form, where the inputs is example: 2002-02-02
. And if users have this birthday it should echo it out. But the problem is that it checks with the year, and I'm trying to only get month and day, not year.
I have tried with EXTRACT(MONTH FROM ...)
but didn't get it to work. What am I missing?