I am trying to make a login which works perfectly until I try and add remember me functionality into the User class.
if ( $user ) {
// check login password agaisnt the hash
if (Hash::verify($password, $this->data()['password'])) {
Session::put($this->_sessionName, $this->data()['id']);
if ($remember) {
$this->mysqli->insert('user_session', array(
'user_id' => $this->data()['id'],
'hash' => uniqid(),
));
}
}
return true;
}
return false;
I am getting the error.
mysqli_stmt::bind_param(): Number of elements in type definition string doesn't match number of bind variables
But when I echo out the query out I have the correct number of elements.
SELECT * FROM users WHERE id= ?SELECT * FROM users WHERE id= ?INSERT INTO user_session ( `user_id`, `hash`) VALUES (?, ?)
Does anyone have any idea? I think someone the other queries are affecting it somehow but i'm not sure how.