open(); } function open() { if ( !$this->connect ) { $this->connect = new mysqli( $this->server, $this->user, $this->passwd, $this->database ); if ( $this->connect->connect_errno ) { log_error( "Échec de la connexion : => " . $this->connect->connect_error . "
" . __file__ . ' ligne ' . __line__); return false; } } $this->connect->set_charset("utf8"); return true; } function close() { $this->connect->close(); $this->connect = 0; } function protect( $string ) { return $this->connect->real_escape_string( $string ); } function query( $string ) { //log_write( $string ); if ( empty( $this->connect ) ) $this->open(); $this->result = $this->connect->query( $string ) ; if ( $this->connect->error ) log_error( "Échec de la commande query => " . $this->connect->error . "
" . __file__ . ' ligne ' . __line__ . "\n" . $string, true, true); //print_r( $this ); } function print_error() { print_r( $this ); //$this->error = $this->error; return $this->connect->error; } } ?>