public __construct ( boolean $connect = true, string $database = null, string $server = null, string $username = null, string $password = null, string $charset = null ) | ||
$connect | boolean | (Optional) Auto-connect when object is created |
$database | string | (Optional) Database name |
$server | string | (Optional) Host address |
$username | string | (Optional) User name |
$password | string | (Optional) Password |
$charset | string | (Optional) Character set |
public function __construct($connect = true, $database = null, $server = null, $username = null, $password = null, $charset = null)
{
if ($database !== null) {
$this->db_dbname = $database;
}
if ($server !== null) {
$this->db_host = $server;
}
if ($username !== null) {
$this->db_user = $username;
}
if ($password !== null) {
$this->db_pass = $password;
}
if ($charset !== null) {
$this->db_charset = $charset;
}
if (strlen($this->db_host) > 0 && strlen($this->db_user) > 0) {
if ($connect) {
$this->Open();
}
}
}
function __construct($connect = true, $database = null, $server = null, $username = null, $password = null, $charset = "utf8", $port = null) { parent::__construct($connect, $database, $server, $username, $password, $charset, $port); if (parent::Error()) { parent::Kill(); } $this->ErrorMsgs = array(); }