I am trying to make a calendar view. I need to check if a $currentDateTime
is between a startdate
and enddate
in a mysql query.
I have tried this query, based on Compare dates in MySQL
SELECT id, startdate, enddate FROM hirings
WHERE startdate <= '$currentDateTime'
AND enddate <= '$currentDateTime'
where $currentDateTime is in format dd-mm-yyyy hh:mm
but it doesn't seem to work, I keep getting 0 rows
returned.
Any help would be appreciated :)