<?php
$id=mysql_connect("localhost","root","123");
mysql_select_db("login", $id);
$user_name=$_POST["user_name"];
$user_pw=$_POST["user_pw"];
$query="select * from user_info where user_name='$user_name'";
$rst=mysql_query($query , $id);
if (mysql_num_rows($rst)== 0){
echo "用户不存在,请<a href=land.html>返回</a> ";
}
else{
$user=mysql_fetch_array($rst,MySQL_ASSOC);
if($user["user_pass"]!=$user_pw){
echo"密码错误,请<a href=land.html>返回</a>";
}else{
echo"恭喜你,登陆成功<br>";
echo"用户名:".$user["user_name"]."<br>";
}
}
?>
运行提示:--当输入正确帐号就会提示下面:
Warning: mysql_fetch_array() [function.mysql-fetch-array]: The result type should be either MYSQL_NUM, MYSQL_ASSOC or MYSQL_BOTH. in C:\iis\land_action.php on line 20
请问是哪里错了???已经确定land.html没问题