我有一个注册用户的登录表单,但是当输入正确的电子邮件和密码时,它似乎不想重定向。不知道为什么我从我的查询中得到一个 0?我错过了一些明显的东西吗?
<?php
session_start();
require_once('includes/db_connect.php');
if($_SERVER["REQUEST_METHOD"] == "POST"){
// Define $email and $mypassword
$email = mysql_real_escape_string($_POST['email']);
$password = mysql_real_escape_string($_POST['password']);
$qry="SELECT * FROM dontblame WHERE email='$email' and password='$password'";
$result = mysql_query($qry);
$count = mysql_num_rows($result);
if($count==1){
$_SESSION['user']=$email;
header('location: ../dashboard.php');
}
else {
$login_err = "<p>Your email or password is incorrect.</p>";
}
mysql_close();
}
?>
编辑:这是我得到的错误......
FROM dontblame WHERE email='XXXXXXX@gmail.com' and password='e6a52beca192a3fd67c8a0ea52cdea29162dd265'" resource(3) of type (mysql result)