src/Adapters/MySQLi.php
public function connect($host = false, $user = false, $password = false, $database = false, $newLink = false)
    {
        $this->connection = mysqli_connect($host, $user, $password, $newLink);

        if ($this->connection) {
            if ($this->selectDatabase($database)) {
                $this->query("SET CHARACTER SET utf8");
                $this->query("SET NAMES utf8");
                return $this->connection;
            } else {
                $message = 'Cannot select database ' . $database;
            }
        } else {
            $message = mysqli_error($this->connection);
        }

        if (!$this->connection) {
            trigger_error($message, E_USER_WARNING);
        }
    }
public function connect($host = false, $user = false, $password = false, $database = false, $newLink = false)
    {
        $this->connection = mysqli_connect($host, $user, $password, $newLink);

        if ($this->connection) {
            if ($this->selectDatabase($database)) {
                $this->query("SET CHARACTER SET utf8");
                $this->query("SET NAMES utf8");
                return $this->connection;
            } else {
                $message = 'Cannot select database ' . $database;
            }
        } else {
            $message = mysqli_error($this->connection);
        }

        if (!$this->connection) {
            trigger_error($message, E_USER_WARNING);
        }
    }
public function connect ( $ host = false , $ user = false , $ password = false , $ database = false , $ newLink = false ) { $ this -> connection = mysqli_connect ( $ host , $ user , $ password , $ newLink ) ; if ( $ this -> connection ) { if ( $ this -> selectDatabase ( $ database ) ) { $ this -> query ( "SET CHARACTER SET utf8" ) ; $ this -> query ( "SET NAMES utf8" ) ; return $ this -> connection ; } else { $ message = 'Cannot select database ' . $ database ; } } else { $ message = mysqli_error ( $ this -> connection ) ; } if ( ! $ this -> connection ) { trigger_error ( $ message , E_USER_WARNING ) ; } }
Connects to MySQL server

@param string|boolean $host
@param string|boolean $user
@param string|boolean $password
@param string|boolean $database
@param bool $newLink

@return resource
Connects to MySQL server