[eluser]Miguel Diaz[/eluser]
Hi I am trying to save some information in my database depending of an information I have on a table but it doesnt work, I am not to good with php and this is for my job I apprecciate all the help you can give me thanks.
Controller
Code:
$names = $this->db->query("select encuestaPreguntaID from encuestaPregunta where encuestaID='1'");
$info = array(
foreach ($names->result() as $row):
$_POST['txt'.$row->encuestaPreguntaID]);
endforeach;
);
foreach ($info as $value):
$data = array(
'encuestaPreguntaID' => $this->input->post('encuestaID'),
'respuesta' => $value
);
$this->db->insert('encuestaRespuesta', $data);
endforeach;
echo 'Done';
Thanks in advance