Hi all,
I have a date from a html form and I want to compare it with dates in a SQL Server Database.
The html form date has this format: YYYY-MM-DD
And I formatted the Database date to this: YYYY-MM-DD
So is the below the correct way of checking if the dates clash? Thanks.
if(($class_start >= $date_start_db) && ($class_start <= $date_end_db)
|| ($class_end > $date_start_db) && ($class_end <= $date_end_db)
|| ($class_start <= $date_start_db) && ($class_end > $date_start_db))