October 28th, 2013, 07:40 PM
How to prevent a table row from displaying based on number of registrants in another
I am a VERY new newbie to PHP, so any help would be greatly appreciated!
I have one table that is prepopulated with data for different classes available and a second table that is connected to a form for people to register for those classes.
I want to be able to prevent a row from the classes table from displaying once the number of people that have registered has reached the max capacity.
The other tricky part is each class will have different max levels. For example, class 1 could max out at 15 participants, but class 2 could max out at 5.
Any help with examples would be GREATLY appreciated!!!
October 28th, 2013, 08:23 PM
this is a MySQL question.
Store the maximum capacity in the classes table. And then use a query that counts the participants and rejects the classes which have reached the maximum (with a HAVING clause).