I want to build a system where an admin can create forms with the program and users enter data to those forms. Also, admins should be able to enter any field names to their forms, even selectable multiple choice questions.
Only answer I can come up with is creating a huge text block for every form type generated and storing form fields, names, choices, etc serializing them from an array or object.
I would keep the users answers in serialized arrays in another text block, assigning each one with their positions in arrays.
Is there a better approach for this problem?
An EAV data model may suit your purposes here. Just be aware that you’ll pay for the flexibility with some downsides, such as lack of referential integrity and long queries to retrieve data (every attribute you want to return requires another JOIN).