public function auth id password id intval id password this- mysqli- e

1
2
3
4
5
6
public function auth($id, $password) {
$id = intval($id);
$password = $this->mysqli->escape_string($password);
$cnt = current($this->mysqli->query("SELECT COUNT(*) as count FROM users WHERE id='$id' AND password='$password'")->fetch_assoc());
return (boolean) $cnt;
}