public function login($email,$password){
$stmt=$this->pdo->prepare("SELECT 'user_id' from 'users' WHERE 'email'= :email AND 'password'=:password");
$stmt->bindParam(":email", $email, PDO::PARAM_STR);
$stmt->bindParam(":password", md5($password) , PDO::PARAM_STR);
$stmt->execute();
$user=$stmt->fetch(PDO::FETCH_OBJ);
$count=$stmt->rowCount();
if($count > 0){
$_SESSION['user_id'] = $user->user_id;
header('Location: home.php');
}else{
return false;
}
The count variable is always showing 0 on echoing in php even though my database has enteries and so even after entering the correct username and password I am not forwared to home.php page. What might be the problem?