As you may have noticed from title, my question is quite difficult to express, but there is problem:
I have MySQL table with some data:
In registration form I have to specify reservation start and end times. How can I check, whether there is already registered reservation for specified time or not. For example I should not be able to put new reservation which starts at 13:20 and ends at 15:00 etc.
If either the start or the end of the new reservation you want to create is inside a current range, the reservation should be blocked. Using
:reservationEnd as these dates, you could query:
SELECT * FROM reservations WHERE :reservationStart BETWEEN reservation_from AND reservation_to OR :reservationEnd BETWEEN reservation_from AND reservation_to OR