Welcome Guest, Not a member yet? Register   Sign In
foreach and array error can someone help me please
#1

[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


Messages In This Thread
foreach and array error can someone help me please - by El Forum - 01-29-2012, 04:06 PM
foreach and array error can someone help me please - by El Forum - 01-29-2012, 06:12 PM
foreach and array error can someone help me please - by El Forum - 01-29-2012, 07:39 PM



Theme © iAndrew 2016 - Forum software by © MyBB