I feel this is so basic, but it just seems too easy and obvious and why didn't someone suggest this 10 years ago. And I know there a lot of much brighter people than me in the software dev business...
So I've been asked to do a quick-n-dirty job (2 days) for a web page app - collect a form, retrieve and duplicate form as text not form elements. All via browser. Tool stack is limited to basic LAMP setup and whatever the web guys/gals can squeeze in via jquery, etc.
No problem. I'd normally set up a db table with a field for each element captured, appropriate data types, lengths, etc. parse and sanitize the input, insert to db with prepared statements, etc. then retrieve and re-display via a template and tokens. Basic CRUD stuff, have quiet a few web apps that do all sorts of stuff like that already, no problem.
But the issue is the form that needs to be filled out has areas where multiple sub-records (what schools attended - school, dates, degrees if any awarded - could be one, could be seven). And there are quite a few other forms that could use the same process. And the web guys/gals want to be able to do this without me being so involved (I agree - programming is only about 30% of my job).
So I'm thinking that each form has something in common with all the others - first name, last name, and email address. Anything else after that is up in the air, the only guarantee is no file uploads.
Would I be asking for trouble if I were to set up a simple generic processing script that submitted to a table, laid out as
pk | webform name | first name | last name | email address | submission timestamp | complete form as JSON string
Doing something like this seems so simple and trivial... I have to wonder...
Set up the insert, and for retrieves an almost-API for the web guys/gals to grab the data with, simply present them the JSON string. No worries about a second/third/Nth table with relationships back to the demographic stuff, having to create databases and tables for each one individually, etc.
Am I setting myself up for trouble for data storage this way? It seems too easy. What am I missing?
EDIT - the follow up
And now, a few months later... I went with storing JSON string to represent the complete form, but only as a one-of quick and dirty fix. Re-creating the form with the users content for edits is trivial and working well.
Unfortunately, stuck on very old versions of software due to ITS (they do infrastructure and ERP stuff, my group is separate and does all "regular" web) and changing to something like PHP 5.6 or even 7.x is out at the moment, and just forget about MongoDB or any other server side stuff.
Am working with the front end folks and trying to come up with a real solution but things are on hold as the semester starts (we all go nutz doing other things for a month) so any other solutions presented would be great.