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,10 +95,12 @@ class MSSQLDatabase extends Database {
}
public function __destruct() {
if($this->mssql) {
mssql_close($this->dbConn);
} else {
sqlsrv_close($this->dbConn);
if(is_resource($this->dbConn)) {
if($this->mssql) {
mssql_close($this->dbConn);
} else {
sqlsrv_close($this->dbConn);
}
}
}