Here is the code below.
function confirmUserID($session_id, $userid) {
$a= "SELECT session_id FROM user_sessions WHERE session_id = '$session_id' AND userid = '$userid'";
$stmt = $this->db->prepare($a);
$stmt->execute(array(':userid' => $userid, ':sessionid' => $session_id));
$count = $stmt->rowCount();
if (!$stmt || $count < 1) {
return 1; //failed user
}
$dbarray = $stmt->fetch();
/
if ($session_id == $dbarray['session_id']) {
return 0; // userid is correct
} else {
return 2;
}
}
What I have tried:
Am new to PHP and need help with this error.
tried to look but i cant search the problem.