[eluser]boltsabre[/eluser]
On a side note, why you passing stuff like
Code:
$today =date("Y-m-d");
$hidden = array('data_criacao' => $today, 'identidade' => $this->session->userdata('user_id'));
from your view, to your controller, and then finally to your model?
- You exposed the "user_id" in a public html form (it MAY be a security problem),
- You've created extra coding for yourself (thus potential for extra bugs).
- You've made extra variables (thus making your server work harder)
- You're html code is now bigger (increasing the size of the file that needs to be served to the user, eating up your bandwidth, etc).
You could have easily just done this in your model!
Code:
$new_data=array(
'identidade'=>$this->session->userdata('user_id'),
'titulo'=>$data['titulo'],
'descricao'=>$data['descricao'],
'referencia'=>$data['referencia'],
'data_criacao'=>date("Y-m-d"),
'nome_empresa'=>$data['nome_empresa'],
'email'=>$data['email'],
'local_de_trabalho'=>$data['local_de_trabalho']);
Don't feel bad, I think we all start coding like this, but this is a much better way of coding, you should only ever assign something to a variable if you absolutely have to! Glad you go your problem solved!