select * from tbl
where hotel_id = $hotel_id and rmtype_id = $rmtype_id and
(($checkin_date between checkin_date and checkout_date) or
($checkout_date between checkin_date and checkout_date))
SELECT * FROM tbl
WHERE (hotel_id = $hotel_id)
AND (rmtype_id = $rmtype_id)
AND ((checkin_date >= $checkin_date )
AND (checkout_date <= $checkout_date))
$sql = " SELECT * FROM tbl WHERE (hotel_id = $hotel_id) AND (rmtype_id = $rmtype_id) AND (checkin_date >= $checkin_date ) AND (checkout_date <= $checkout_date)) ";