mirror of
https://github.com/silverstripe/silverstripe-mssql
synced 2024-10-22 08:05:53 +02:00
MINOR Set the database as active if changed the connection using selectDatabase()
This commit is contained in:
parent
0d1b808700
commit
8b8dc91e7c
@ -38,7 +38,6 @@ class MSSQLDatabase extends Database {
|
||||
* - database: The database to connect to
|
||||
*/
|
||||
public function __construct($parameters) {
|
||||
|
||||
$this->dbConn = mssql_connect($parameters['server'], $parameters['username'], $parameters['password']);
|
||||
$this->active = mssql_select_db($parameters['database'], $this->dbConn);
|
||||
|
||||
@ -212,7 +211,9 @@ class MSSQLDatabase extends Database {
|
||||
$this->database = $dbname;
|
||||
|
||||
if($this->databaseExists($this->database)) {
|
||||
mssql_select_db($this->database, $this->dbConn);
|
||||
if(mssql_select_db($this->database, $this->dbConn)) {
|
||||
$this->active = true;
|
||||
}
|
||||
}
|
||||
|
||||
$this->tableList = $this->fieldList = $this->indexList = null;
|
||||
|
Loading…
Reference in New Issue
Block a user