本文整理匯總了PHP中dbex::getCount方法的典型用法代碼示例。如果您正苦於以下問題:PHP dbex::getCount方法的具體用法?PHP dbex::getCount怎麽用?PHP dbex::getCount使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類dbex
的用法示例。
在下文中一共展示了dbex::getCount方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: count
case 'basic':
// case 'basic'
$sql = "select email, pro, con, reg_time from user where user_id = '{$_SESSION['uid']}' limit 1";
$res = $dbo->getRow($sql);
$email = $res['email'];
$pro = $res['pro'];
$con = $res['con'];
$reg_time = $res['reg_time'];
break;
default:
// case 'action'
if ('user' == $_SESSION['role']) {
// 個人用戶
//$sql_count = "select count(1) from do_task where user_id = {$_SESSION['uid']} and (status=11 or status=21)";
$sql_count = "select count(1) from do_task where user_id = {$_SESSION['uid']} and status=11";
$count = $dbo->getCount($sql_count);
global $action_per_page;
$per_page = $action_per_page;
$total_page = ceil($count / $per_page);
if (isset($_GET['page']) && intval($_GET['page']) >= 1 && intval($_GET['page']) <= $total_page) {
$page = intval($_GET['page']);
} else {
$page = 1;
}
// 提取當前用戶做過的任務的 任務id,任務屏顯名稱,任務傭金,任務類型 , 完成時間 按照時間倒序
// status: 11 - 正常完成;21 - 屏蔽;
$sql = "select task_id, task_type, owner_name, income, time from do_task where user_id = {$_SESSION['uid']} and do_task.status = 11 order by do_id desc";
$start = ($page - 1) * $per_page;
$sql_res = $dbo->getPage($sql, $start, $per_page);
} else {
if ('ader' == $_SESSION['role']) {