Jump to content

PHP- how to select a dropdown value using mysql


hgkhkhk

Recommended Posts

I am trying to prevent a booking (record from being inserted) based on the number of people attending a room. So in this case,a specific room cannot be booked if more than a certain number of people are attending.

 

For example, I have a field called 'people' in the database. Attached to this is a dropdown list containing dropdown values of 1,2,3,4,5,6,7,8,9,10. (The number of people attending.)

 

I also have a field called 'room' in the database. Attached to this is also a dropdown list containing the values 'room a', 'room b' and 'room c.'

 

The user must select a room (either 'room a' 'room b' 'room c') and has to select the number of people attending (either 1, 2, 3, 4, 5, 6 ,7, 8, 9,10)

 

How would I prevent 'room a' from being booked(record inserted) if more than 7 people are selected from the dropdown list?

 

Thank you.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.