本文整理汇总了PHP中ADORecordSet::RowCount方法的典型用法代码示例。如果您正苦于以下问题:PHP ADORecordSet::RowCount方法的具体用法?PHP ADORecordSet::RowCount怎么用?PHP ADORecordSet::RowCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ADORecordSet
的用法示例。
在下文中一共展示了ADORecordSet::RowCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getVariableArrayFromRecordSet
/**
* Converts a ADORecordSet object into an array of "rows" that
* are subarrays of variable => value pairs.
*
* @param ADORecordSet $dbRecordSet Anything ADOConnection::Execute() can return
* @return array
*/
protected function getVariableArrayFromRecordSet(ADORecordSet $dbRecordSet, $strResultForm)
{
$arResult = array();
switch ($strResultForm) {
case 'construct':
$arResultVars = $this->query->getConstructPatternVariables();
break;
default:
$arResultVars = $this->query->getResultVars();
break;
}
if (in_array('*', $arResultVars)) {
$arResultVars = array_keys($this->sg->arVarAssignments);
}
//work around bug in adodb:
// ADORecordSet_empty does not implement php5 iterators
if ($dbRecordSet->RowCount() <= 0) {
return array();
}
foreach ($dbRecordSet as $row) {
$arResultRow = array();
foreach ($arResultVars as $strVar) {
$strVarName = (string) $strVar;
if (!isset($this->sg->arVarAssignments[$strVarName])) {
//variable is in select, but not in result (test: q-select-2)
$arResultRow[$strVarName] = '';
} else {
$arVarSettings = $this->sg->arVarAssignments[$strVarName];
$strMethod = $this->arCreationMethods[$arVarSettings[1]];
$arResultRow[$strVarName] = $this->{$strMethod}($dbRecordSet, $arVarSettings[0], $strVar);
}
}
$arResult[] = $arResultRow;
}
return $arResult;
}