mysql - In what format should I store data of a large php form with few dynamic fields -
i have large php form dynamic fields , there can additional fields added after releasing production. how store large data mysql database using php can handle dynamic fields , additional fields. example of form can seen in link below.
http://form.jotform.me/form/50655815937465
the above link doesn't contain dynamic fields may contain later.
the main form huge divided different sections. need handle well. need save draft concept user can save data , load later when gets chance complete it.
there's lot of different ways handle this, i'll make simple recommendation
for static fields
- create column in table each static field
- save each static field submission in corresponding column
for dynamic fields
- create array of dynamic values , call
serialize
on it - store serialized value in single long text column in database
- to read values, have call
unserialize
on it
pros
- easy implement
- ability filter data based on static inputs
- only uses 1 column dynamic inputs
- supports large amount of dynamic form inputs
cons
- difficult filter data based on dynamic inputs
alternative solutions
these solutions more robust require deeper understanding. i'll leave these here research on own.
Comments
Post a Comment