我已经创建了一个“登录操作按钮表单”的表单,如下所示
<?php
include "dbconnect.php";
$username = $_POST['username'];
$password = $_POST['password'];
$query = "select * from login where username='$username' AND password='$password'";
// var_dump($result);
$result = mysql_query($query);
$count = mysql_num_rows($result);
if($count==1)
{
header("location:fill-detail.php");
}
else
{
echo 'Sorry, Wrong ID and Password';
}
?>
我使用了ver_dump,结果数组也显示,但输出给出警告: mysql_num_rows():提供的参数不是有效的MySQL结果。