public function connect() { $dsn = 'sqlsrv:Server=' . $this->_server; if (!empty($this->_port)) { $dsn .= ', ' . $this->_port; } $dsn .= '; Database=' . $this->_database; parent::__construct($dsn, $this->_username, $this->_password, $this->_driver_options); $this->_connected = true; }
public function connect() { $dsn = 'mysql:dbname=' . $this->_database . ';host=' . $this->_server; if (!empty($this->_port)) { $dsn .= ';port=' . $this->_port; } $this->_connected = true; $dbh = parent::__construct($dsn, $this->_username, $this->_password, $this->_driver_options); if ($this->_has_native_fk === false) { $this->setupForeignKeys(); } return $dbh; }
public function connect() { $dsn = 'sqlite:' . $this->_server; $this->_connected = true; return parent::__construct($dsn, $this->_username, $this->_password, $this->_driver_options); }