Select for Meeting Room Scheduling Mysql

1

The problem follows: I am creating a system for meeting room scheduling. I would like to ensure that it will not be possible to schedule the same room in the same period. So after completing the inclusion form in the table it will check if the time and room in that period are available. Using BETWEEN between the start and end times of the schedule, Example if you already have a schedule from 9am to 11am in the meeting room and try to hold the appointment at 8:30 am until 9:30 am he advises that he can not schedule however when having to hold the appointment from 9:30 am to 10:30 pm he leaves, I wonder how I can "book" this space so I do not scheduling occurs at the same time.

    
asked by anonymous 08.11.2017 / 14:19

1 answer

0

We came to the conclusion that doing the following query would solve the need:

SELECT * FROM salas_reuniao WHERE meeting_room = '$salaReuniao' AND hour_start <= '$inicioReuniao' AND hour_end >= '$finalReuniao' 
    
08.11.2017 / 14:55