{ $this->db_addr = $db_addr; $this->db_user = $db_user; $this->db_pass = $db_pass; $this->querycount = 0; if ( $use_pconnect ) { $this->link = @mysqli_connect("p:".$db_addr, $db_user, $db_pass); } else { $this->link = @mysqli_connect($db_addr, $db_user, $db_pass); } if ( $this->link ) { $q = @mysqli_query($this->link, "SET NAMES 'utf8'"); @mysqli_free_result($q); if ( $db_name != '' ) { $this->db_name = $db_name; if ( !@mysqli_select_db($this->link, $db_name) ) { @mysqli_close($this->db_connect_id); $this->error("Could not select database '$db_name'. Check that the value of DB_NAME in config.php is set correctly."); } } return $this->link; } else { $this->error('Could not connect to database server. Check that the values of DB_ADDR, DB_USER and DB_PASS in config.php are set correctly.'); } }