登录功能报错
问题描述
Fatal error: Call to undefined function mysql_num_row() in E:phpStudyWWW0330daimalogin_a.php on line 33
if(mysql_num_row($result)==0){
说是这一句,下面是完整代码
<?php
session_start();
$username=$_POST["username"];
$password=$_POST["password"];
include("config.php");
if(empty($username)){
echo ("<script type='text/javascript'> alert('用户名不能是空的');history.go(-1);</script>");
}
if(empty($password)){
echo ("<script type='text/javascript'> alert('密码不能是空的');history.go(-1);</script>");
}
//echo $username.$password;
$db=mysql_connect("127.0.0.1","root","root");
mysql_select_db("performance",$db);
mysql_query("SET NAMES 'GB2312'");
$_POST["username"];
$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 ("<script type='text/javascript'> alert('用户名或密码不正确!');history.go(-1);</script>");
mysql_close();
exit;
}else{
$_SESSION["admin"]="lee";
echo "<script>location.href='Admin.html';</script>";
}
?>
问题解答
回答1:print_r(get_extension_funcs('mysqli'));
是mysqli_num_rows(),函数名称写错了.细心点哦~
相关文章:
1. html5 - 百度Ueditor代码高亮和代码段滚动条冲突是怎么回事?2. 如何调整IDEA中直接运行java程序的日志输出级别?3. debian - docker依赖的aufs-tools源码哪里可以找到啊?4. javascript - vue 数据更新了。但是dom没有更新,,,,,如图5. javascript - 静态页面引公共头尾文件,js怎么写吖?6. docker api 开发的端口怎么获取?7. java - 为什么要将Runnable接口的子类对象传递给Thread的构造函数?8. java基础,求解答。9. css3中translate(-50%,-50%)对 transform-origin的奇葩影响?10. css - 关于input标签disabled问题