时间:2021-07-01 10:21:17 帮助过:4人阅读
mysqli=new mysqli($dbhost,$dbuser,$dbpwd,$dbname); if(mysqli_connect_errno()) { echo "物品数据库连接失败!"; } } public function close() { if($this->mysqli) $this->mysqli->close(); $this->mysqli=FALSE; } public function _destruct() { $this->close(); } } class UserDB extends Database { public function queryUserByName($name) { $query="SELECT * FROM Users WHERE name='".$name."'"; if ($result=$this->mysqli->query($query)) //此处提示出错!! return true; else return false; }
queryUserByName($lvalue["name"]); echo "alert"; if($rtmp) //这个名字没有注册 { $rusers=new User($lvalue); if($udb->addUser($rusers)) { setcookie("start",0); setcookie("userInfo",serialize($rusers)); setcookie("username",$rusers->name); header("Location:../view/index.php"); } else header("Location:../view/errors.php?value=tianjia"); } break; }