Let's say that in a registration form I have several fields whose values are selectable and for each field the list of values is different from the others, the conventional would be to create a table for each field with the options and to display in the select. p>
- But when it is necessary to create a very large number of these tables?
- Will I have to make a table for each select that is different?
- I thought about creating a recursive table for the selects options with
Id, IdPai e Nome
, I'm told, or is there another better way to to do this?
Let's go to the practical example:
I have a main table with 10 INT (11) fields that will be populated in a form according to the user's choice, ID based on the values of a different select list for each field, each field has its own ID tag and values to display.
In this example I would have to create 10 auxiliary tables , one for each select list that I put on the form.
What I want to know is if you are creating a table from categories of selects with a IDPai , a ID > and the name of select I would achieve the same result as the previous example.
In this way I could have a parent category with the name " SELECT1 " and several child categories containing the values of that parent " Yes "; " no "; " maybe "; and so on, " SELECT2 " -> " On "; " Off ", and in the main table I would save the ID that was selected .