I’m developing a participant-event registration web app in php and have come across the following problem:
We have multiple events for our tech-fest in college and have around 4000 participants. At the registration desk, the participants have to be signed up for the events(single/multiple). At one point, the admin must be able to LOCK the event so that participants can no longer register for that event(meaning the event has already started). Then, the admin needs to be able to print out a list of all the people who have signed up for each event(after LOCKing).
We came up with this:
- have a BOOLEAN column for each event in the ‘participant’ table
- have a multiple select field as the interface for event input
- implode() the received array
- explode() the result
- set foreach explod()ed event, set BOOLEAN as 1 against the participant
so when the admin wants a print, get all participants where BOOLEAN for event-name is set to 1
This looks like a little ugly, and we’re hoping someone has a better idea to work around this. Thank you.
Sounds like you could use some normalization. “boolean column for each event”. So if you’ve got 50 events, you’ve got 50 columns? It would make far more sense to have an events table, a users table, and an “events_users” table to link the two, e.g:
The ‘lock’ field goes into the events table. Then getting the participants is as easy as: