0
I’m trying to enter some data in the database but I can’t. Some problem in the array that Codeigniter returns.
Follow the Controller that the form calls:
function cadastrar()
{
$this->load->helper('array');
$dados = array();
$dados2 = array();
$dados2 = $this->input->post(NULL, TRUE);
$this->load->model('Entidade_model', '', TRUE);
if($this->Entidade_model->cadastrar($dados2))
{
$dados['tp_msg'] = 'success';
$dados['msg'] = '<strong>Warning!</strong> Entidade inserida com sucesso!';
}
else{
$dados['tp_msg'] = 'danger';
$dados['msg'] = '<strong>Warning!</strong> Erro ao inserir entidade.';
}
$this->load->view('alert', $dados);
}
Follow the Model Controler sends the data:
function cadastrar(array $data)
{
return $this->db->insert('entidade', $data);
}
And he didn’t register.
And what would be this problem in the array?
– Maniero
it would be interesting to know the return too
– Otto