美好的一天,请帮我解决($userRow=$stmt->fetch(PDO::FETCH_ASSOC);
)
public function doLogin($uname,$umail,$upass)
{
try
{
$stmt = $this->conn->prepare("SELECT acctID, username, email, password FROM tbl_user WHERE username=:uname OR email=:umail ");
$stmt->execute(array(':uname'=>$uname, ':umail'=>$umail));
$userRow=$stmt->fetch(PDO::FETCH_ASSOC);
if($stmt->rowCount() == 0)
{
if(password_verify($upass, $userRow['password']))
{
$_SESSION['user_session'] = $userRow['acctID'];
return true;
}
else
{
return false;
}
}
}
catch(PDOException $e)
{
echo $e->getMessage();
}
}