验证logjphp:为什么给我一个错误?

验证logjphp:为什么给我一个错误?,php,mysql,sql,Php,Mysql,Sql,我正在写一个登录验证系统,当我做这个的时候 <?php include('connect.php'); $Nome = stripslashes(mysql_real_escape_string($_POST['Nick'])); $Pass = stripslashes(mysql_real_escape_string($_POST['pass'])); $Query = mysql_query("SELECT * FROM table WHERE utenti='.$Nome.' AN

我正在写一个登录验证系统,当我做这个的时候

<?php
include('connect.php');
$Nome = stripslashes(mysql_real_escape_string($_POST['Nick']));
$Pass = stripslashes(mysql_real_escape_string($_POST['pass']));
$Query = mysql_query("SELECT * FROM table WHERE utenti='.$Nome.' AND password='.$Pass.'");
if(mysql_num_rows($Query)==1) {
    session_register("$Nome");
    header("Location:chat.php");
}
else {
    echo "<b>Username or password incorrect!</b>";
}
?>

b因为查询中的引号和双引号不正确。即使我将SELECT*FROM chat WHERE utenti='“$Nome.”和password='“$Pass.”“问题仍然存在。为什么?为什么不直接回显表的结果,看看是否存在与数据相关的问题?我试图将其放入,但它总是说“用户名或密码不正确!”!“这是对我的回答吗?还是前面的注释?如果是对我的,那么只需注释掉检查的整个代码,并添加回显代码进行测试