I have an HTML form with a <select> list. This list has many options (over 200), but let's say, for simplicity, there are four.
<input type="text" name="country" placeholder=" your name">
<input type="email" name="email" placeholder=" your e-mail">
<select>
<option value="skateboard">skateboard</option>
<option value="scooter">scooter</option>
<option value="parkour">parkour</option>
<option value="bmx">bmx</option>
</select>
User data is currently processed with PHP and dropped into a MySQL database accessed via phpMyAdmin.
This works fine. One table gathers all user data in three columns – name, e-mail and option.
The problem is that each option represents a different division of the company and having all options dropped into the same table requires manual sorting.
An employee sorts through the table, cuts out all "skateboard" entries and sends them to the proper team. Same cut/paste process for "scooter", "parkour" and "bmx". So this one table is being manually divided into four parts.
My goal is to remove the manual sorting component and automate the entire process.
I'm thinking we could instead have four different tables, one dedicated to each option. When an entry is received for "skateboard", the data is dropped into table 1, "scooter" goes into table 2, etc. No more human intervention required.
I can envision a clunky and bloated PHP script handling the job, but I'm thinking MySQL provides a more efficient solution.
Unfortunately, my experience with MySQL is quite limited. Looking for "the right" starting point in the MySQL Reference Manual has so far been fruitless. What rules or programs am I looking for?
select name, e-mail from table where option = 'bmx'or something (and build separate php pages for those)