Page 1 of 1

Trying to make "on this date" work

Posted: Mon Jun 05, 2006 3:49 pm
by j1982
Hi, newbie here.

I have a few thousand dates in a MySQL table (yyyy-mm-dd format) and want an "on this date" section for my php/MySQL-driven site. If, say, it is December 14th, I want it to show anything ending in -12-14. I've experimented with using a % (ex. - WHERE date = '%-12-14'), and that works as long as I tell the query what days to look for. But I want it to automatically look for all -12-14s, or whatever today's month and day is.

Any suggestions?

Posted: Mon Jun 05, 2006 3:51 pm
by hawleyjr
Check out the mysql date functions

http://dev.mysql.com/doc/refman/5.0/en/ ... tions.html

There is about 3 ways to do it ;)