BUGFIX MSSQLDatabase::__destruct() should check if the db handle is a resource before attempting to close it, otherwise it'll give a warning about an invalid MSSQL link, when it should've said "unable to connect to server"

This commit is contained in:
Sean Harvey 2009-07-28 04:07:42 +00:00
parent 4c2cb7f3e9
commit 82dcbb89d2

View File

@ -95,12 +95,14 @@ class MSSQLDatabase extends Database {
} }
public function __destruct() { public function __destruct() {
if(is_resource($this->dbConn)) {
if($this->mssql) { if($this->mssql) {
mssql_close($this->dbConn); mssql_close($this->dbConn);
} else { } else {
sqlsrv_close($this->dbConn); sqlsrv_close($this->dbConn);
} }
} }
}
/** /**
* Throw a database error * Throw a database error