MINOR Check for $this->mssql in MSSQLDatabase::__destruct()

MINOR Removed Debug from MSSQLQuery::__destruct()
MINOR Code formatting fixes in MSSQLQuery
This commit is contained in:
Sean Harvey 2009-07-27 21:50:54 +00:00
parent 915457b86b
commit f555c3518f

View File

@ -95,14 +95,12 @@ class MSSQLDatabase extends Database {
} }
public function __destruct() { public function __destruct() {
if(is_resource($this->dbConn)) { if($this->mssql) {
if(function_exists('mssql_close')) {
mssql_close($this->dbConn); mssql_close($this->dbConn);
} elseif(function_exists('sqlsrv_close')) { } else {
sqlsrv_close($this->dbConn); sqlsrv_close($this->dbConn);
} }
} }
}
/** /**
* Throw a database error * Throw a database error
@ -1246,7 +1244,6 @@ class MSSQLQuery extends Query {
* @param handle the internal mssql handle that is points to the resultset. * @param handle the internal mssql handle that is points to the resultset.
*/ */
public function __construct(MSSQLDatabase $database, $handle, $mssql) { public function __construct(MSSQLDatabase $database, $handle, $mssql) {
$this->database = $database; $this->database = $database;
$this->handle = $handle; $this->handle = $handle;
$this->mssql = $mssql; $this->mssql = $mssql;
@ -1255,7 +1252,6 @@ class MSSQLQuery extends Query {
} }
public function __destroy() { public function __destroy() {
Debug::message("Destroying query");
if($this->mssql) { if($this->mssql) {
mssql_free_result($this->handle); mssql_free_result($this->handle);
} else { } else {
@ -1263,9 +1259,8 @@ class MSSQLQuery extends Query {
} }
} }
/* /**
* Please see the comments below for numRecords * Please see the comments below for numRecords
*
*/ */
public function seek($row) { public function seek($row) {
if($this->mssql) { if($this->mssql) {
@ -1286,7 +1281,6 @@ class MSSQLQuery extends Query {
* rowset, cache it, and then do the count on that. This is probably resource intensive. * rowset, cache it, and then do the count on that. This is probably resource intensive.
* *
* For this function, and seek() (above), we will be returning false. * For this function, and seek() (above), we will be returning false.
*
*/ */
public function numRecords() { public function numRecords() {
if($this->mssql) { if($this->mssql) {