/*class DB_Mysql { protected $uzytkownik; protected $haslo; protected $host; protected $baza; protected $dbh; protected $wynik; public $zapytan; public function __construct($uzytkownik, $haslo, $host, $baza) { $this->host = $host; $this->uzytkownik = $uzytkownik; $this->haslo = $haslo; $this->baza = $baza; } protected function connect() { $this->dbh = mysql_pconnect($this->host, $this->uzytkownik, $this->haslo); mysql_query('SET CHARACTER SET utf8;',$this->dbh); mysql_query('SET NAMES utf8;',$this->dbh); if(!is_resource($this->dbh)) { //miejsce na obsluge bledow } if(!mysql_select_db($this->baza, $this->dbh)) { //miejsce na obsluge bledow } $this->zapytan=0; } public function zapytaj_sql($query) { if(!$this->dbh) { $this->connect(); } $ret = mysql_query($query, $this->dbh); $this->zapytan++; if(!$ret) { return FALSE; //miejsce na obsluge bledow } else if(is_resource($ret)) { $this->wynik=$ret; return $ret; } else { return FALSE; } } public function ostatnio_dodane_id() { return mysql_insert_id(); } public function fetch_row() { return mysql_fetch_row($this->wynik); } public function num_rows() { return mysql_num_rows($this->wynik); } public function fetchall_row() { $retval = array(); while($row = $this->fetch_assoc()) { $retval[] = $row; } return $retval; } public function fetch_assoc() { return mysql_fetch_assoc($this->wynik); } public function zmodyfikowane_rekordy() { return mysql_affected_rows($this->dbh); } public function fetchall_assoc() { $retval = array(); while($row = $this->fetch_assoc()) { $retval[] = $row; } return $retval; } } ?> */