0
I have a dynamic form that is filled as there are questions in the database, this form also writes text boxes, checkbox, textareas, etc according to the type of question defined in the database, the problem is that when doing Ubmit I need him to take every question and every answer and insert it into different lines of the database, but I’m not able to do that.
Now I’m doing it differently, every set of inputs I want on different lines are distinguished by (name-idPergunta)
array(22) { ["privacidade-16"]=> string(1) "1" ["idPergunta-16"]=> string(2) "16" ["resposta-16"]=> string(14) "Vitor Bonzinho" ["privacidade-17"]=> string(1) "1" ["idPergunta-17"]=> string(2) "17" ["resposta-17"]=> string(10) "2015-10-10" ["privacidade-18"]=> string(1) "1" ["idPergunta-18"]=> string(2) "18" ["idRespostaPre-18"]=> string(2) "19" ["privacidade-19"]=> string(1) "1" ["idPergunta-19"]=> string(2) "19" ["resposta-19"]=> string(16) "Rua do mormugão" ["privacidade-20"]=> string(1) "1" ["idPergunta-20"]=> string(2) "20" ["idRespostaPre-20"]=> string(2) "38" ["privacidade-21"]=> string(1) "1" ["idPergunta-21"]=> string(2) "21" ["resposta-21"]=> string(8) "4465-213" ["privacidade-30"]=> string(1) "1" ["verificada-30"]=> string(1) "1" ["idPergunta-30"]=> string(2) "30" ["idRespostaPre-30"]=> array(2) { [0]=> string(3) "186" [1]=> string(3) "188" } }
How do I get the controller to separate these sets and make Inserts one of each x?
insert all inputs that have -16 insert all inputs that have -17 ... hereafter
Thanks in advance
What exactly is your difficulty? Make the dynamic form or query query?
– Ivan Ferrer
the dynamic form is already done, but when submitting I want to divide the entire form into groups, that is, the complete form has several questions, each question will have answer either text or multiple choice, will also have a field that says whether that question is private or not and whether it has already been verified or not. but when doing Ubmit it sends me everything together and I am not able to separate by groups (id of the question, idda default answer if it is checkbox, reply if it is text, privacy and verified )
– Laranja Mecânica