I\'m trying to write a query that will check today\'s date against my table columns date1 and date2 in mysql/php.. This is what I\'m after:
\'events\' table:
Though there are many answers available to this question I would like to give my response regarding the same situation I faced.
I am using php to query mysql database.
first what I do is to convert the date in the mysql supported date format which is yyyy-mm-dd
$date = new DateTime($date);
$date=date_format($date, 'Y-m-d');
in the query's where clause I use BETWEEN
"'$date' BETWEEN start_date AND end_date"
this works perfectly given the case described here.