I have MySQL table "room_booking" and this table contain two columns 'start_time' and 'end_time'. I want to check the time of the conference room booking. Suppose that if room is booked from 2:10 PM to 3:15 PM. Then another entry should not insert at between this time. My query is
$queryCheck = "SELECT start_time,end_time FROM room_booking AND (SELECT * FROM (room_booking) WHERE (start_time NOT BETWEEN '".$new_start_time."' AND '".$end_start_time."') AND (end_time NOT BETWEEN '".$new_start_time."' AND '".$end_start_time."'))";