Mam taką klasę obsługi bazy danych:
<?php class db { const CACHE_DIR = './sql_cache/'; public $connect_id; public $db_name; public $query_result; public $zapytan; public $cache_file; public $cache_stan; public $cache_bufor; public function __construct($db_host, $db_user, $db_pass, $db_name) { if($this -> connect_id) { if(!$this -> dbname) { $this -> _error('dbselect'); return false; } else { $this -> db_name = $db_name; return true; } } else { $this -> _error('connect'); return false; } } public function sql_cache( $handle = 0 ) { { { $this -> cache_stan = 1; $this -> cache_file = CACHE_DIR.'cache_'.$handle.'cach'; } else { $this -> cache_stan = 2; $this -> cache_file = CACHE_DIR.'cache_'.$handle.'cach'; } } else { if($this -> cache_stan == 2) { } $this -> cache_stan = 0; } } public function sql_drop_cache( $handle ) { { } } public function query($query) { if($this -> cache_stan != 1) { $this -> query_result = ''; if(!$this -> query_result) { $this -> _error('query'); return false; } else { $this -> zapytan++; return true; } } } public function fetch_row($query_result='') { if($this -> cache_stan == 1) { { return 0; } $array = $this -> cache_bufor; } else { if($this -> cache_stan == 2) { $this -> cache_bufor[] = $array; } } if(!$array) { return false; } else { return $array; } } public function num_rows($query_result='') { if(!$num_rows) { return false; } else { return $num_rows; } } public function __destruct() { if(!$db_close) { $this -> _error('close'); return false; } else { return true; } } public function _error($type) { $text = '<h1>MYSQL ERROR</h1>'; switch($type) { case 'connect': $text .= 'Wystąpił błąd podczas łączenia się z bazą danych!'; break; case 'dbselect': $text .= 'Wystąpił błąd podczas wybierania bazy danych!'; break; case 'query': $text .= 'Wystąpił błąd podczas wykonywania zapytania!'; break; case 'close': $text .= 'Wystąpił błąd podczas zamykania połączenia z bazą danych!'; break; } } } ?>
Próbowałem do tego dodać cachowanie zapytań. No i niby wszystko jest dobrze ale wogle mi nie tworzy pliku cache ;/ Myśle że problem jest w metodzie fetch_row ale nie wiem gdzie.

WIELKIE DZIEKI ZA POMOC
Edit:///
Ok już sobie poradziłem
