I have a contact form with different section like:
My form has three fixed fields class1, class2, class3
and there is a button through which user can add more input fields, So how do I structure my database
to store those additional fields and these forms are user specific i.e there is a user table as well
FORM ID | USER ID
1 1
2 2
3 1
So there can be multiple form as well for a user.
<input name="x1" id="section[class1][section_name]" />
<input name="x2" id="section[class2][section_name]" />
<input name="x3" id="section[class3][section_name]" />
above input field are used to store section name . I am new in database structure so Any kind of link or reference would be appreciated.
This is just an idea I had:
First, create a table called custom_fields with the following fields:
Second, make sure that your forms table has a user_id of type integer in it and that your users table that the user does indeed has an id.
Now, just use the ids to store the values to the appropriate form.