本文整理汇总了PHP中ADORecordSet::RecordCount方法的典型用法代码示例。如果您正苦于以下问题:PHP ADORecordSet::RecordCount方法的具体用法?PHP ADORecordSet::RecordCount怎么用?PHP ADORecordSet::RecordCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ADORecordSet
的用法示例。
在下文中一共展示了ADORecordSet::RecordCount方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: recordset_to_menu
/**
* Utility function used by the following 3 methods.
*
* @param ADORecordSet $rs an ADODB RecordSet object with two columns.
* @return mixed an associative array, or false if an error occurred or the RecordSet was empty.
* @access private
*/
function recordset_to_menu(ADORecordSet $rs)
{
global $CFG;
if ($rs && $rs->RecordCount() > 0) {
$keys = array_keys($rs->fields);
$key0 = $keys[0];
if (isset($keys[1])) {
$key1 = $keys[1];
} else {
$key1 = $keys[0];
}
while (!$rs->EOF) {
$menu[$rs->fields[$key0]] = $rs->fields[$key1];
$rs->MoveNext();
}
return $menu;
} else {
return false;
}
}
示例2: db_num_rows
/**
* Retrieve number of rows returned for a specific database query
* @param ADORecordSet $p_result Database Query Record Set to retrieve record count for.
* @return int Record Count
*/
function db_num_rows($p_result)
{
global $g_db;
return $p_result->RecordCount();
}
示例3:
/**
* Number of rows in current result set
*
* @deprecated use the result-object returned by query/select()->NumRows(), so you can use the global db-object and not a clone
* @return int number of rows
*/
function num_rows()
{
return $this->Query_ID ? $this->Query_ID->RecordCount() : False;
}