mysql - How can I check for date range exists -


as may have noticed title, question quite difficult express, there problem:

i have mysql table data:

enter image description here

in registration form have specify reservation start , end times. how can check, whether there registered reservation specified time or not. example should not able put new reservation starts @ 13:20 , ends @ 15:00 etc.

if either start or end of new reservation want create inside current range, reservation should blocked. using :reservationstart , :reservationend these dates, query:

select *   reservations  :reservationstart between reservation_from , reservation_to or        :reservationend between reservation_from , reservation_to or 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -