注意:尝试获取非对象的属性

时间:2014-03-04 14:39:51

标签: php

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

1 个答案:

答案 0 :(得分:2)

有拼写错误,属性名称区分大小写,$this->objDBConn应为$this->objDbConn