Save dynamic inputs in a BD

0

I've been thinking about how dynamic inputs are stored in a database for a while. Let me explain:

I have a database with an extructure like the following:

Now then. If you had in the form that records this data, inputs generated by the client, which can create 1, 2, 5 or 10 extra fields. How do I store them in my database? Do I put them in an array? I can not think how it can be done

    
asked by Tefef 05.12.2018 в 17:10
source

1 answer

0

I would create a string in which you would encode the extra data: $string = "dato1;dato2;dato3" , and that is stored in a column. Then you use $variable = preg_split(";" $string); which would return an array that is stored in $variable and that way you can access the data

    
answered by 05.12.2018 в 17:31