我有几行PHP
与Mysql
无效。连接正在工作,但查询给我一些问题。
$con=mysqli_connect("localhost","$username","$password","$username");
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$sql="SELECT * FROM `AUT` WHERE USERNAME='$user' AND PASSWORD='$pass'";
$result=mysqli_query($con, $sql);
$rowcount=mysqli_num_rows($result); //line 21
if ($rowcount==1)
{
echo 'WELCOME';
printf("Result set has %d rows.\n",$rowcount);
}
ELSE
{
echo'ERROR';
printf("The Results is %d \n",$result);
}
我一直得到的结果是:
mysqli_num_rows()期望参数1为mysqli_result,boolean 在第21行的/storage/ssd3/588/2634588/public_html/login.php中给出
任何人都可以帮助我吗?