connection = @mysql_connect( $host, $user, $pass, TRUE ); if (!$this->connection) { throw new DB_Exception( 'Konnte keine Verbindung zur Datenbank aufbauen.', @mysql_errno() ); } if (!@mysql_select_db($database, $this->connection)) { throw new DB_Exception( 'Konnte die gewünschte Datenbank nicht auswählen.', @mysql_errno($this->connection) ); } } // ... public function query($query) { if (is_resource($this->connection)) { if (is_resource($this->result)) { @mysql_free_result($this->result); } $this->result = @mysql_query( $query, $this->connection ); if (!$this->result) { throw new DB_Exception( @mysql_error($this->connection), @mysql_errno($this->connection) ); } } } // ... } ?>