database.php中
function insert($sql){
mysqli_query($this->objDbConn, $sql);
if(mysqli_errno($this->objDbConn)){
die("Failed Query: $sql".$this->objDBConn->error);
return false;
}else{
return true;
}
}
update.php
if(isset($_POST["submit"])){
$address= $_POST['address'];
$mail= $_POST['mail'];
$user= $_POST['user'];
$password= $_POST['password'];
$sql= "UPDATE Member(Address, Mail, UserName, Password)VALUES
('$address', '$mail', '$user', '$password')";
$objdatabase->insert($sql);
echo "Update successful";
echo "<META http-equiv='refresh' content='0;URL='>";
}
在网址上显示:
注意:尝试获取非对象的属性
和
注意:未定义的属性:database :: $ objDBConn
答案 0 :(得分:2)
有拼写错误,属性名称区分大小写,$this->objDBConn
应为$this->objDbConn
。