If the user provides a date in the format via aform ($date_booked):
2012-1-6
to be compared against a date (date_booked):
2012-01-06
What would be the correct SQL method to check it be (using phpMyAdmin):
SELECT * FROM room WHERE date_booked LIKE $date_booked
Or would MySQL not return anything?
Thanks in advance.
Assuming you are using TSQL and user entered a correct date
As you have updated your question to MySQL
Here is a good example on how to compare date MySQL – Change date string to date type in place?