[eluser]Unknown[/eluser]
I'm getting a syntax error when I run a query through $this->db->query().
However, I don't get the error when I run it directly in mysql.
Any help would be appreciated.
here is the code
Code:
$name = $this->input->post('name');
$email = $this->input->post('email');
$password = $this->input->post('password');
$sql = "set @salt = floor(rand() * 0xFFFFFFFF);"
. "set @hash = sha1(concat('$password',@salt));"
. "insert into accounts(`name`, `email`, `password_hash`, `password_salt`, `date_created`) "
. "values ('$name', '$email', @hash, @salt, now());";
if($this->db->query($sql)) return $this->try_login();
return $this->db->_error_message();