• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 952
  • Last Modified:

PHP/MySQL Event Manager script with dynamic form elements

Part 1 )

I'm about to develop an "event manager" to allow an organisation to create various events and accept guest registrations and payments. I propose creating a table events and a table for registrations. However, the twist is that different events will require different fields. There will be some standard field e.g. name, email, phone, etc. but some events will require other fields such as medical history, or occupation that are non-standard.

What is the best way to design the database to handle a dynamic list of fields and track the responses for each field?

Part 2 )

Some events will require guests to select sessions in different time slots. For example, when running a conference there may be 10 different time slots in the conference and 5 sessions running in any one time slot. e.g. the time slot "Saturday Afternoon - 2pm to 3.30pm" may have the options "1. PHP Basics", "2. Database basics", "3. Integrating PHP & MySQL".

While working in with the solution to Step 1, what is the best way to allow guests to select sessions for different time slots?
1 Solution
Part 1 )
design diff diff tables for diff diff type of events.

Part 1)

create an events table with an auto increment id including name/address/descreiption etc..

create a table for reservations, with an id, and the event id

create a questions table with an auto increment id also include a field for the event id and a field name and type (checkbox/textfield/dropdown) and a default value field

create another table for options which will reference the questions to get the different options for dropdowns, radios etc.

create another one for answers, reference the reservations id, the even id and the questions id and an answer, to store how they answered each one either to include the actual value (for text boxes,check boxes) of the id in the options table for dropdowns and radios etc..

Part 2)

create a timeslots table, reference the event id, create a field for time and another for the type of lecture, in your sql you can then do like a group by the time where id -eventid to get all the lectures running at that time... or you can create yet another reference table for the luctures names and descriptions and reference the timeslots id

Alter your reservations table to include a timeslot id and a lectures id
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now