Fatal error: Call to undefined function mysql_num_row() in E:\phpStudy\WWW30\daima\login_a.php on line 33
if(mysql_num_row($result)==0){
说是这一句,下面是完整代码
session_start() ;
$username=$_POST["用户名"];
$password=$_POST["密码"];
include("config.php");
if(empty($username)){
echo ("");
}
if(empty($password)){
echo ("<脚本类型= 'text/javascript'>alert('密码不能为空的');history.go(-1);");
}
##//echo $用户名.$密码;$db=mysql_connect("127.0.0.1","root","root"); mysql_select_db("性能",$db); mysql_query("设置名称'GB2312'"); $_POST["用户名"];
##$sql="select * from admin where admin_name='$username' and admin_pw='$password'";
$result=mysql_query($sql);
//$number = mysql_fetch_row($result);
//$result=mysql_fetch_array(mysql_query($sql));
if(mysql_num_row($result)== 0){
echo("<脚本类型='text/javascript'>alert('用户名或密码不正确!');history.go(-1);</script> ");
mysql_close();
退出;
}else{
$_SESSION["admin"]= "lee";
echo "<script>location.href='Admin.html';</script>";
}
?>
print_r(get_extension_funcs('mysqli'));
是mysqli_num_rows(),函数名称写错了.细心点哦~