I have a dynamic form that is filled as there are questions in the database, this form tb writes text boxes, checkboxes, textareas, etc according to the type of question defined in the database, the problem is that when submitting I need that it picks up every question and answer and inserts it into different rows of the database, but I can not do that.
NowI'mdoingitdifferently,eachsetofinputsIwantondifferentlinesaredistinguishedby(name-idQuestion)
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 insert one of each x?
insert all inputs that have -16 insert all inputs that have -17 ... thereafter
Thank you in advance