首页上一页 1 下一页尾页 1 条记录 1/1页
php+mysql开发实战
发表在PHP图书答疑
2015-09-09
是否精华
是
否
版块置顶:
是
否
php+mysql开发实战第十八章-物流管理系统:
用网页打开首页显示
Fatal error: Call to a member function fetch_array() on a non-object in C:\AppServ\www\18\index.php on line 62
代码:
<?php
if(isset($_POST['admin_user']) || isset($_POST['admin_pass'])){
$conn=new mysqli("localhost","root","5377047","db_database18");
$conn->query("set names gb2312");
$admin_user=$_POST['admin_user'];
$admin_pass=md5($_POST['admin_pass']);
$sql=$conn->query("call admin_reg('".$admin_user."','".$admin_pass."')");
$res=$sql->fetch_array(MYSQL_BOTH); //这里第62行
if($res!=NULL){
$_SESSION['admin_user']=$_POST['admin_user'];
$_SESSION['admin_pass']=md5($_POST['admin_pass']);
echo "<script>alert('管理员登录成功!');window.location.href='indexs.php';</script>";
}else{
echo "<script>alert('管理员登录失败!');</script>";
}
}
?>
用网页打开首页显示
Fatal error: Call to a member function fetch_array() on a non-object in C:\AppServ\www\18\index.php on line 62
代码:
<?php
if(isset($_POST['admin_user']) || isset($_POST['admin_pass'])){
$conn=new mysqli("localhost","root","5377047","db_database18");
$conn->query("set names gb2312");
$admin_user=$_POST['admin_user'];
$admin_pass=md5($_POST['admin_pass']);
$sql=$conn->query("call admin_reg('".$admin_user."','".$admin_pass."')");
$res=$sql->fetch_array(MYSQL_BOTH); //这里第62行
if($res!=NULL){
$_SESSION['admin_user']=$_POST['admin_user'];
$_SESSION['admin_pass']=md5($_POST['admin_pass']);
echo "<script>alert('管理员登录成功!');window.location.href='indexs.php';</script>";
}else{
echo "<script>alert('管理员登录失败!');</script>";
}
}
?>