Mailinglisten-Archive | 
Hallo.
Habe eine Datenbak-Klasse gebastelt die den Zugriff auf die DB abwickeln
soll.
### Auszug aus database.inc.php ###
/* Perform Query */
function query($query) {
if (!$this->conn) {
$this -> error = "Unable to Perform Query! No connection to Database
found!";
$this -> throwError();
return false;
}
if (!$this->result = _(at)_mysql_query($query, $this->conn)) {
$this -> error = "Failed Query! Reason: ".mysql_error();
$this -> throwError();
return false;
}
return true;
}
function numRows() {
if (!$this->result ) {
$this -> error = "Unable to return numRows, no query!";
$this -> throwError();
return false;
}
$data = mysql_num_rows($this->result);
if (!$data) {
$this -> free();
return false;
}
return $data;
}
### Auszug Ende ###
Nun ergibt sich folgendes Problem: Nachdem ich eine Query gemacht habe,
wird ja die Res.ID in $this->result gespeichert. Wenn ich dann numRows()
aufrufe, ist $this->result auch noch korrekt, doch die Abfrage "if
(!$this->result) ..." bricht schon ab und auch ein direktes "echo
mysql_num_rows($this->result);" führt zum Fehler "Warning: Supplied
argument is not a valid MySQL result resource".
Wo liegt denn der gottverdammte Fehler??
Criena
    php::bar PHP Wiki - Listenarchive