I have a search where a user can specify the search date range byt setting: From Month + Year and To Month + Year
I'd like to have some sort of logic in place to display error if they specify overlapped dates, like:
From June 2005 to May 2005
or
From June 2006 to July 2005
Here's how use the date range in my db search query:
SELECT *
FROM mytable
WHERE MONTH(event_date) >= ".$FROMmonth."
AND YEAR(event_date) >= ".$FROMyear."
AND MONTH(event_date) <= ".$TOmonth."
AND YEAR(event_date) <= ".$TOyear."
🆒