0

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='>";
}

that show on the url:

Notice: Trying to get property of non-object

and

Notice: Undefined property: database::$objDBConn

noooooooo
  • 1
  • 4
  • and now i have Failed Query: UPDATE Member showing my url so i wonder is it cant connect to the database? – noooooooo Mar 04 '14 at 14:47
  • Related: [How to get useful error messages in PHP?](http://stackoverflow.com/q/845021/367456) – hakre Mar 04 '14 at 16:40

1 Answers1

2

There is a typo, property name is case sensitive, $this->objDBConn should be $this->objDbConn.

xdazz
  • 158,678
  • 38
  • 247
  • 274