Kod:
<?php class db { var $zapytania = 0; var $conn = false; var $errors = 0; var $debug = false; var $identyfikator = false; function err($errtxt, $errno){ $this->errors++; if($this->debug) { echo "MySQL zwrócił błąd numer:".$errno.". O treści:".$errtxt.". Zapytanie nie mogło zostać wykonane"; } } function connect($host, $user, $pass, $baza){ if(!$connection){ $this->err($mysql_error, $mysql_errno); } else { $this->conn = true; } if(!$bazaselect){ $this->err($mysql_error, $mysql_errno); $this->conn = false; } else { $this->identyfikator = $connection; } } function query($query){ if(!$doquery) { $this->err($mysql_error, $mysql_errno); } else { $this->zapytania++; return $doquery; } } function close(){ $this->conn = false; $this->identyfikator = false; } } ?>
Dalej chciałbym normalnie operować na zapytaniu, np. mysql_fetch_assoc itp.