Basically i'm doing a simple wedding planner and i am trying to check whether the date that the user has inserted as available or whether the venue is booked. Basically, it's falling over with my SQL query. Initially i am setting the time:
$time = mktime(0, 0, 0, $month, $day, $year);
Then i have an sql query where i am checking it against an id variable that is previously set and the date that is passed through.
$sql2 = "SELECT * FROM venue_booking WHERE date_booked = ".$time." AND venue_id =".$id;
In this case the date in the database is 2015-01-01 and the date i'm passing through is 2015-01-01, I am checking this in an if statement if the amount of rows returned from the database is greater than 0 then echo booked, else echo available.
Even if the output is meant to say booked it still says available. Is there an issue with the way i am checking the time against mysql's date.
date_booked - This is a MySQL date (2014-01-01)
Anybody have any ideas?