Error\n"; echo '

'.htmlspecialchars(stripslashes($message))."

\n"; if(!empty($debug)) echo '

Debug information: '.htmlspecialchars(stripslashes($debug))."

\n"; exit; } } function connect() { $connection = @mysql_connect($this->config['host'],$this->config['user'],$this->config['pass']); $error = mysql_error(); if(!$connection) $this->_err("Impossible de se connecter à la base de donnée.",$error,TRUE); $result = @mysql_select_db($this->config['db']); $error = mysql_error(); if(!$result) $this->_err("Impossible de sélectionner la base de données.",$error,TRUE); return TRUE; } function checkDB() { $result = mysql_query("SHOW TABLES"); if(!$result) return FALSE; while($rec = mysql_fetch_row($result)) $tables[] = $rec[0]; foreach($this->checkTables as $table) { if(!@in_array($table,$tables)) return FALSE; } return TRUE; } function query($query) { $result = mysql_query($query); if(!$result) $this->_err("Error in query: $query",mysql_error(),TRUE); return $result; } function array_query($query) { $result = mysql_query($query); if(!$result) $this->_err("Error in query: $query",mysql_error(),TRUE); $out = array(); while($rec = mysql_fetch_array($result)) $out[] = $rec; return $out; } function unbuffered_query($query) { $result = mysql_unbuffered_query($query); if(!$result) $this->_err("Error in query: $query",mysql_error(),TRUE); return $result; } function q($query) { return $this->query($query); } function aquery($query) { return $this->array_query($query); } function uquery($query) { return $this->unbuffered_query($query); } function insert_id() { return mysql_insert_id(); } } ?>