本文整理匯總了PHP中Reports::search_counter方法的典型用法代碼示例。如果您正苦於以下問題:PHP Reports::search_counter方法的具體用法?PHP Reports::search_counter怎麽用?PHP Reports::search_counter使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Reports
的用法示例。
在下文中一共展示了Reports::search_counter方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Reports
//page end is actually the range to show 5 rec, 10 recs, etc.
$page_end = $_REQUEST['page_end'];
} else {
$page_end = "10";
}
if (!empty($_REQUEST['client_id'])) {
$keyword = $_REQUEST['client_id'];
$field = 'client_id';
} else {
$client_id = "";
}
$r = new Reports('unknown', BASE_DOMAIN);
if (!empty($_REQUEST['keyword'])) {
$reports = $r->search($keyword, $field, $page_start, $page_end);
//returns paged results
$reports_count = $r->search_counter($keyword, $field);
//get search result count
echo "<b>Result(s): " . $reports_count . "</b><br /><hr>";
} elseif (!empty($_REQUEST['uid'])) {
//get one report from search results
$uid = $_REQUEST['uid'];
$reports = $r->getReport($uid);
} else {
echo "Sorry, No Results Found <br /><br />";
die;
}
$pager_count = $reports_count;
//total records for query
$pager_range = count($reports);
//total currently displayed
$pager_end = $page_start + $pager_range;