Thema: PHP/Mysqli
Einzelnen Beitrag anzeigen
  #1  
Alt 06.01.2010, 11:22:59
mercutio31 mercutio31 ist offline
Anfänger
 
Registriert seit: Jan 2010
Alter: 45
Beiträge: 1
PHP/Mysqli

Guten Morgen,vielleicht könnt Ihr mir bei meinem Denkfehler helfen!!!

config.php
PHP-Code:
<?php

class mysqlidb extends mysqli {
        
        protected 
$MySQLiObj;
        public 
$result;
        
        
/** Konstruktor */
        
public function __construct() {
        require_once(
'conf.inc.php');
            
$MySQLiObj = @parent::__construct($mysqlhost$mysqluser,$mysqlpasswd$mysqldb);
            
            
/** Prüfen, ob ein Fehler aufgetreten ist. */
            
if (mysqli_connect_errno()) {
                die (
mysqli_connect_error() . ' Error No. ' mysqli_connect_errno());
            }
        }
        
        
/** Destruktor */
        
public function __destruct() {
            if (
$this -> MySQLiObj) {
                
$this -> close();
            }
        }
        
        
/** Methoden */
        
public function getQuery($qry) {
            
            
$this -> result parent::query($qry);
            
            return 
$this -> result;
        }
        
        public function 
getFetchArray() {
            return 
$this -> fetch_array();
        }
        
        public function 
getFetchAssoc() {
            return 
$this -> fetch_assoc();
        }
        public function 
getFetchRow() {
        return 
$this -> fetch_row();
    }
        public function 
getNumRows() {
            return 
$this -> affected_rows();
        }
    
    public function 
getFetchObject() {
        return 
$this -> fetch_object();
    }

        public function 
getLastInsertedID() {
            return 
mysqli_insert_id($this);
        }
    }

?>
test.php
PHP-Code:
<?php
error_reporting
();
ini_set ('error_reporting'1);
include(
'inc/conf.php');

function 
LoadLang($lang)
{                
    
$db = new mysqlidb();
    
$text = array($lang);
    
$result "select `key`,`$lang` from contents order by id;";
    
$result $db->Query();
    while(
$row $result->getFetchRow()):
    
$text[$row[0]] = $row[1];
    endwhile;
    return 
$text;
}
Ich erhalte folgende Fehlermeldung
Fatal error: Call to a member function getFetchRow() on a non-object in ziele 16

Zeile 16 ->
PHP-Code:
while($row $result->getFetchRow()): 

Danke für eure Hilfe
Mit Zitat antworten