ezSQL_mysqli::__construct PHP Method

__construct() public method

******************************************************************** Constructor - allow the user to perform a quick connect at the same time as initialising the ezSQL_mysqli class
public __construct ( $dbuser = '', $dbpassword = '', $dbname = '', $dbhost = 'localhost', $encoding = '' )
    function __construct($dbuser = '', $dbpassword = '', $dbname = '', $dbhost = 'localhost', $encoding = '')
    {
        $this->dbuser = $dbuser;
        $this->dbpassword = $dbpassword;
        $this->dbname = $dbname;
        list($this->dbhost, $this->dbport) = $this->get_host_port($dbhost, 3306);
        $this->encoding = $encoding;
    }

Usage Example

示例#1
0
 /**
  * Comply to YOURLS debug mode
  *
  * @since 1.7.1
  */
 function __construct($user, $pass, $name, $host)
 {
     $this->show_errors = defined('YOURLS_DEBUG') && YOURLS_DEBUG;
     parent::__construct($user, $pass, $name, $host);
 }