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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.