I'm trying to select the birthdays that fall on a given day. This means that the month and day have to match but I don't care about the year. The b-days are stored as a date in a mysql database.
this doesn't work:
$sql= "SELECT bday FROM calendar";
$sql.=" where (month(bday) = $month) and (day(bday) = $day)";
The month clause works but the day clause gives me an error.
So I tried this:
$sql= "SELECT bday FROM calendar";
$sql.=" where (month(bday) = $month) and (bday like '%-$day')";
and it works fine but I don't like the syntax. It seems sloppy to me. What's the real way to do this?
Thanks for your time
Mark