What i'm doing is kind of complicated to explain but Ill do my best. I have about 10 different forms, some that share the same questions and some that dont. They are all radio buttons. So far i am able to validate (make sure each question is answered) and get the value of all the questions. What i want to do is take all the values from the form and send it to a PHP script which will then add it to the database. I was wondering if there was a way that I could write a PHP script that loops through all the variables present passed from the javascript(jquery to be exact) and insert it into the database. I know I could check for each variable individually and create an sql INSERT string for each one but that would be too cumbersome when i go to add more forms. Along with that, when i go to send the variables from jquery(using ajax) to php should i put them in a regular array or a JSON object. If its a json object how do i go about populating for the object?
I suggest serializing the array and insert it into one simple field then when you need the infos just unserialize