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:
query:
But I'm not sure how to go about it.. any help would be appreciated :)
EDIT:
Maybe I was unclear.. if todays date = '2012-01-18' I need it to find results if today's date is between the date range of date1 and date2.. So date1 may be '2012-01-04' and date2 may be '2012-01-21'.. so if todays date falls between or on those dates, a result is returned..
SELECT * FROM events
WHERE date1<='2012-01-18'
AND date2>='2012-01-18'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With