host = "localhost"; $this->db = "tp4"; $this->user = "root"; $this->pass = ""; $this->link = mysql_connect($this->host, $this->user, $this->pass); mysql_select_db($this->db); //register_shutdown_function($this->close); } // Méthodes de la classe function query($query) { $this->result = mysql_query( $query, $this->link ); } function fetch() { return mysql_fetch_array( $this->result, MYSQL_ASSOC ); } function close() { mysql_close($this->link); } } ?>