Hey,
I have a method that checks credentials and returns true if it matches.
The problem is that it always returns false. I thought fetch_row() would do the trick to check if there is a row that matches those credentials? But it's not working.PHP Code:public function loginUser($strUsername, $strPassword) {
$result = $this->hDB->query("SELECT firstname, lastname, username, password, email, session
FROM user
WHERE username = '$strUsername'
AND password = '$strPassword'");
if ($row = ($result->fetch_row()) == 1) {
$this->firstname = $row->firstname;
$this->lastname = $row->lastname;
$this->username = $row->username;
$this->passowrd = $row->password;
$this->email = $row->email;
$this->session = $row->session;
return true;
}
return false;
}
Looking for a hand![]()






Bookmarks