I am trying to make a login form using mysqli method.I am not getting any error but in both case (Correct or Incorrect Authentication) I am getting the second part of the IF condition result! "You are not allowed!."
<?php
include_once('db.php');
$eMail = mysql_real_escape_string($_POST["eMail"]);
$passWord = mysql_real_escape_string($_POST["psword"]);
$query = "SELECT count(*) FROM users WHERE (email='$eMail' AND pass='$passWord')";
if( $query > 0 ) {
echo "You are allowed.";
}
else{
echo "You are not allowed!.";
}
$mysqli->close();
?>
I also changed to if condition to following
if( $mysqli->query > 0 ){}
users というテーブルと、ユーザーの Email と Password を含む 2 つの列 (email、pass) があります。何が間違っているのか教えてください。ありがとう