oResultSet = $oResultSet; if (PEAR::isError($oResultSet)) { $this->broken = true; } } function isEmpty () { global $default; if ($this->broken) { return $this->oResultSet; } return ($this->oResultSet->numRows() == 0); } function next () { global $default; if ($this->broken) { return $this->oResultSet; } $aNextResult = $this->oResultSet->fetchRow(DB_FETCHMODE_ASSOC); if ($aNextResult === null) { return null; } return new SqlResultAdapter ($aNextResult); } } class SqlResultAdapter { function SqlResultAdapter ($oResult) { $this->oResult = $oResult; } function get ($sField) { global $default; return $this->oResult[$sField]; } } class PatternTableSqlQuery extends PatternTableGeneric { function PatternTableSqlQuery($sTmpQuery, $aTmpColumns, $aTmpColumnTypes, $aTmpColumnHeaderNames, $sTmpWidth, $aTmpLinkURLs = null, $aTmpDBQueryStringColumns = null, $aNewQueryStringVariableNames = null) { $oResult = DBUtil::runQuery($sTmpQuery); $oResultSet =& new SqlResultSetAdapter ($oResult); $this->PatternTableGeneric($oResultSet, $aTmpColumns, $aTmpColumnTypes, $aTmpColumnHeaderNames, $sTmpWidth, $aTmpLinkURLs, $aTmpDBQueryStringColumns, $aNewQueryStringVariableNames); } } ?>