I have a simple application in which users submit data to a table.
There are currently three fields that the user can pass to values ββat the moment. I am trying to find a solution in which the number of description columns may vary depending on the description list created by the user.
So far I have been considering:
- the presence of the user_input table has many values ββwith a zero field value, say, from 1 to 15 and thereby limiting the number of field descriptions that the user can define to 15. This solution is very easy to query and maintain, but is limited by a limited number of fields. (Is this a viable and acceptable solution in general?)
- creating a table in which each row will match the 1 description entered. This will allow the user to create an unlimited number of description fields, however, storing each of all inputs will instead of 1 line now accept n-lines, where n is the number of linked links to the current list_ description. Users can select the sum of the columns, but they are not so simple to request and support.
My current table looks something like this:
CREATE TABLE `user_input` ( `id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL, `description_list_id` int(11) NOT NULL, `description1` int(11) NOT NULL, `description2` int(11) NOT NULL, `description3` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Are there any other solutions?
sql mysql database-design
neo112
source share