From 8b8dc91e7ca3054f71e74dca5647c20a95bd3c12 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Tue, 28 Apr 2009 05:41:43 +0000 Subject: [PATCH] MINOR Set the database as active if changed the connection using selectDatabase() --- code/MSSQLDatabase.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/MSSQLDatabase.php b/code/MSSQLDatabase.php index 0dd3826..8975b4c 100644 --- a/code/MSSQLDatabase.php +++ b/code/MSSQLDatabase.php @@ -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;