There are a couple of ways of doing this: one strictly with PHP, the other by using jQuery to trigger ajax. Either method is ok with me.
I have a registration form which takes the person's personal information and stores it in a table on a MySQL database. There is a field that offers people the opportunity to sign up for a consultation appointment. There are two appointments available for each time slot. When someone chooses '11:00' on this form, this information needs to be submitted to the database. If someone has already signed up for one of the appointments at 11:00, a message saying 'Only one appointment left!' needs to show up beside the 11:00 option. If two people have already signed up for this time slot, 11:00 would no longer show up as an option at all.
Time slots are as follows:
(again, two appointments may be booked for each time slot)
I require all MySQL coding to be in the mysqli format. I can show you the code I have so far, and how I would like to integrate this into things (at present, there is a single-page form with consultation choices, but nothing that shows if someone has already chosen this time slot).