PHP Notice: Undefined özellik: stdClass:

0 Cevap

Ben Flash Builder 4 oluşturulan Flash uygulaması geri gelen bir dizi var.

Ben sorgular ve başarılı bir şekilde geri DB'den veri getiriyor, ancak güncelleştirme komut Tanımsız Mülkiyet hataları üreten bir servis kurulum var.

Ben hala PHP ve Flash Builder hem öğrenme yaşıyorum ve tam $ this-> komutları ne anlamıyorum.

Herkes bu komut yanlış nereye önerebilirsiniz, bu temelde sadece Flash Builder tarafından oluşturulan ve kendimi geliştirdim şey değildir, bunu takdir ediyorum?

Birisi bana bu-> $ açıklayabilir Ayrıca eğer bu çok harika olurdu?

Ben önce onları gördüm, ama sonra ben komut onları kullanmak değil aynı şeyi yapıyor gördüm, bu yüzden bu şeyler yapmanın eski bir yoldur?

Gerçekten herhangi bir giriş herkes verebilir teşekkür ederiz.

Tam PHP kodu için güncellendi.

Oluşturulan Hatalar.

[18-Haziran-2010 13:01:37] PHP Notice: Undefined özellik: C stdClass :: $ inst_code: \ wamp \ www Coradia-175105-debug \ hizmetler \ \ tbltrustservice.php 48 hattı üzerinde

[18-Haziran-2010 13:01:37] PHP Notice: Undefined özellik: C stdClass :: $ trust_name: \ wamp \ www Coradia-175105-debug \ hizmetler \ \ tbltrustservice.php 48 hattı üzerinde

[18-Haziran-2010 13:01:38] PHP Notice: Undefined özellik: C stdClass :: $ trust_code: \ wamp \ www Coradia-175105-debug \ hizmetler \ \ tbltrustservice.php 48 hattı üzerinde

[18-Haziran-2010 13:01:38] PHP Notice: Undefined özellik: C stdClass :: $ trust_key: \ wamp \ www Coradia-175105-debug \ hizmetler \ \ tbltrustservice.php 48 hattı üzerinde

        <?php

//reroute errors to get rid of that annoying CHANNEL DISCONNECTED message.
ini_set('error_log', 'errorLog.txt');
ini_set('html_errors', '0');
ini_set('display_errors', '0');
ini_set('log_errors', '1');

class tbltrustservice {

    public $connection;

    public function connect() {
            $this->connection = mysqli_connect("ahoey-1:3306",  "<Username Removed For StackOverflow>",  "<Password Removed for StackOverflow>", "enabmodules") or die(mysqli_connect_error());
    }

    public function getAllItems($search) {
              $this->connect();

              if ($search=="") {
              $sql = "SELECT * FROM tbltrust";
              } else {
              $sql = 'SELECT * FROM tbltrust WHERE trust_name LIKE \'%'.mysql_escape_string($search).'%\' OR trust_code LIKE \''.mysql_escape_string($search).'%\' OR inst_code LIKE \'%'.mysql_escape_string($search).'%\'';
              }

              $result = mysqli_query($this->connection, $sql) or die('Query failed: ' . mysqli_error($this->connection));

              $rows = array();
              while ($row = mysqli_fetch_object($result)) {
                    $rows[] = $row;
              }

              mysqli_free_result($result);
              mysqli_close($this->connection);

              return $rows; 
    }



    public function updateItem($item) {
        // TODO Auto-generated method stub
        // Update an existing record in the database and return the item

        // Sample code \'

              $this->connect();
              $sql = "UPDATE tbltrust SET inst_code = '$item->inst_code', trust_name = '$item->trust_name', trust_code = '$item->trust_code' WHERE  trust_key = '$item->trust_key'";

              mysqli_query($this->connection, $sql) or die('Query failed: ' . mysqli_error($this->connection));

              mysqli_close($this->connection);

    }


/*
    public function updateItem($item) {

        $stmt = mysqli_prepare($this->connection, "UPDATE $this->tablename SET trust_code=?, trust_name=?, inst_code=? WHERE trust_key=?");     
        $this->throwExceptionOnError();

        mysqli_stmt_bind_param($stmt, 'sssi', $item->trust_code, $item->trust_name, $item->inst_code, $item->trust_key);        
        $this->throwExceptionOnError();

        mysqli_stmt_execute($stmt);     
        $this->throwExceptionOnError();

        mysqli_stmt_free_result($stmt);     
        mysqli_close($this->connection);
    }
*/
    public function getItem($itemID) {
        // TODO Auto-generated method stub
        // Return a single record from the database and return the item

        // Sample code
        /*
              $this->connect();
              $itemID = mysqli_real_escape_string($this->connection, $itemID);
              $sql = "SELECT * FROM books where itemID=$itemID";

              $result = mysqli_query($this->connection, $sql) or die('Query failed: ' . mysqli_error($this->connection));

              $rows = array();
              while ($row = mysqli_fetch_object($result)) {
                    $rows[] = $row;
              }

              mysqli_free_result($result);
              mysqli_close($this->connection);

              return $rows;
        */  
    }

    public function createItem($item) {
        // TODO Auto-generated method stub
        // Insert a new record in the database using the parameter and return the item

        // Sample code
        /*
              $this->connect();
              $sql = "INSERT INTO books (title, au_first_name, au_last_name) 
              VALUES ('$item->title','$item->au_first_name','$item->au_last_name')";  

              mysqli_query($this->connection, $sql) or die('Query failed: ' . mysqli_error($this->connection));

              $autoid= mysqli_insert_id($this->connection);
              mysqli_close($this->connection);

              return $autoid;
        */  
    }

/*
public function updateItem($item) {

        $stmt = mysqli_prepare($this->connection, "UPDATE tbltrust SET trust_code=?, trust_name=?, inst_code=? WHERE trust_key=?");     
        $this->throwExceptionOnError();

        mysqli_stmt_bind_param($stmt, 'sssi', $item->trust_code, $item->trust_name, $item->inst_code, $item->trust_key);        
        $this->throwExceptionOnError();

        mysqli_stmt_execute($stmt);     
        $this->throwExceptionOnError();

        mysqli_stmt_free_result($stmt);     
        mysqli_close($this->connection);
    } */

    public function deleteItem($itemID) {
        // TODO Auto-generated method stub
        // Delete a record in the database

        // Sample code
        /*
              $this->connect();
              $itemID = mysqli_real_escape_string($this->connection, $itemID); 
              $sql = "DELETE FROM books WHERE itemID = $itemID";

              mysqli_query($this->connection, $sql) or die('Query failed: ' . mysqli_error($this->connection));

              mysqli_close($this->connection);
        */  
    }

    public function count() {
        // TODO Auto-generated method stub
        // Return the number of items in your array of records

        // Sample code
        /*
              $this->connect();
              $sql = "SELECT * FROM books";

              $result = mysqli_query($this->connection, $sql) or die('Query failed: ' . mysqli_error($this->connection));
              $rec_count = mysqli_num_rows($result);

              mysqli_free_result($result);
              mysqli_close($this->connection);

              return $rec_count;
        */  
    }

    public function getItems_paged($startIndex, $numItems) {
        // TODO Auto-generated method stub
        // Return a page of records as an array from the database for this startIndex

        // Sample code
        /*
              $this->connect();
              $startIndex = mysqli_real_escape_string($this->connection, $startIndex); 
              $numItems = mysqli_real_escape_string($this->connection, $numItems); 
              $sql = "SELECT * FROM books LIMIT $startIndex, $numItems";

              $result = mysqli_query($this->connection, $sql) or die('Query failed: ' . mysqli_error($this->connection));

              $rows = array();
              while ($row = mysqli_fetch_object($result)) {
                    $rows[] = $row;
              }

              mysqli_free_result($result);
              mysqli_close($this->connection);

              return $rows;
        */  
    }


    }

?>

0 Cevap