Welcome Guest, Not a member yet? Register   Sign In
uniqid insert mysql
#1

[eluser]Thiago Leao[/eluser]
hi friends,

I want to insert encrypted id.
md5 (uniqid ())

How do the query here?

Code:
function insert($data){    

$array = array('nome'=> $data['nome'], 'login' => $data['login'], 'senha' => $data['senha'], 'date' => date('Y-m-d'), 'session_date' => date('Y-m-d h:m:s'));
$this->db->set($array);
$this->db->insert('users');

}

thanks!!
#2

[eluser]Thiago Leao[/eluser]
Anyone, pls?
thanks!
#3

[eluser]WanWizard[/eluser]
What's wrong with
Code:
function insert($data){    

$array = array('id' => md5(uniqid()), 'nome'=> $data['nome'], 'login' => $data['login'], 'senha' => $data['senha'], 'date' => date('Y-m-d'), 'session_date' => date('Y-m-d h:m:s'));
$this->db->set($array);
$this->db->insert('users');

}
#4

[eluser]Thiago Leao[/eluser]
That's right!!!
thanks my firend!

=)




Theme © iAndrew 2016 - Forum software by © MyBB