I have table called reservations.And I have following values.
res_id hotel_id room_type start end qty
1048 1 standard 2015-05-18 2015-05-20 1
I have a hotel search option. And if user enter start date as 2015-05-16 and end date as 2015-05-19 and search my bookedrooms.php display zero value for standard room type. My sql query is;
$sql1 = mysql_query("select * from reservations where start >= '".$start."'
and
end <= '".$end."' and room_type = 'standard' ");
if there any error in my checking dates,
start >= '".$start."' and end <= '".$end."'
Are start and end actual dates? If so you should probably cast them.
"select * from reservations where start >= date('".$start."') and end <= date('".$end."') and room_type = 'standard' "