本文整理匯總了PHP中mysql::get_total方法的典型用法代碼示例。如果您正苦於以下問題:PHP mysql::get_total方法的具體用法?PHP mysql::get_total怎麽用?PHP mysql::get_total使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類mysql
的用法示例。
在下文中一共展示了mysql::get_total方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: dirname
* 使用;不允許對程序代碼以任何形式任何目的的再發布。
* ============================================================================
*/
define('IN_QISHI', true);
require_once dirname(__FILE__) . '/../../include/common.inc.php';
require_once QISHI_ROOT_PATH . 'include/fun_wap.php';
require_once QISHI_ROOT_PATH . 'include/mysql.class.php';
require_once QISHI_ROOT_PATH . 'include/fun_personal.php';
$smarty->cache = false;
$db = new mysql($dbhost, $dbuser, $dbpass, $dbname);
$act = !empty($_REQUEST['act']) ? trim($_REQUEST['act']) : 'password_edit';
if ($_SESSION['uid'] == '' || $_SESSION['username'] == '' || intval($_SESSION['utype']) == 1) {
header("Location: ../wap_login.php");
} elseif ($act == 'password_edit') {
$uid = intval($_SESSION['uid']);
$smarty->assign('total', $db->get_total("SELECT COUNT(*) AS num FROM " . table('pms') . " WHERE (msgfromuid='{$uid}' OR msgtouid='{$uid}') AND `new`='1'"));
$smarty->assign('title', '修改密碼 - 個人會員中心 - ' . $_CFG['site_name']);
$smarty->display("wap/personal/wap-password.html");
} elseif ($act == 'save_password') {
require_once QISHI_ROOT_PATH . 'include/fun_user.php';
$arr['username'] = $_SESSION['username'];
$arr['oldpassword'] = trim($_POST['oldpassword']) ? trim($_POST['oldpassword']) : exit('請輸入舊密碼!');
$arr['password'] = trim($_POST['password']) ? trim($_POST['password']) : exit('請輸入新密碼!');
if ($arr['password'] != trim($_POST['password1'])) {
exit('兩次輸入密碼不相同,請重新輸入!');
}
//edit_password()修改密碼的方法
$info = edit_password($arr);
if ($info == -1) {
exit('舊密碼輸入錯誤,請重新輸入!');
}
示例2: intval
if ($category > 0) {
$joinwheresql = " WHERE category=" . intval($category);
if ($subclass > 0) {
$joinwheresql .= " AND subclass=" . intval($subclass);
}
$joinsql .= " INNER JOIN ( SELECT DISTINCT pid FROM " . table('resume_jobs') . " {$joinwheresql} )AS j ON f.resume_id=j.pid ";
}
$perpage = 5;
$count = 0;
$page = empty($_GET['page']) ? 1 : intval($_GET['page']);
if ($page < 1) {
$page = 1;
}
$start = ($page - 1) * $perpage;
$total_sql = "SELECT COUNT(*) AS num FROM " . table('company_favorites') . " as f " . $joinsql . " {$wheresql}";
$count = $db->get_total($total_sql);
$smarty->assign('favorites', wap_get_favorites($start, $perpage, $joinsql . $wheresql));
$smarty->display("m/company/m-collect-resumes.html");
} elseif ($act == "ajax_collect_resume") {
$favoriteshtml = "";
$rows = intval($_GET['rows']);
$offset = intval($_GET['offset']);
$wheresql = " WHERE a.company_uid='{$_SESSION['uid']}' ";
$row = $db->getall("select a.*,r.title,r.fullname,r.sex,r.display_name,r.education_cn,r.birthdate,r.experience_cn,r.residence from " . table("company_favorites") . " as a left join " . table("resume") . " as r on a.resume_id=r.id {$wheresql} order by a.favoritesa_ddtime desc limit {$offset},{$rows}");
if (!empty($row) && $offset <= 100) {
foreach ($row as $list) {
$list["birthdate_"] = date('Y', time()) - $list["birthdate"];
if ($list['display_name'] == "2") {
$list['fullname'] = "N" . str_pad($list['resume_id'], 7, "0", STR_PAD_LEFT);
} elseif ($list['display_name'] == "3") {
if ($list['sex'] == 1) {
示例3: exit
} else {
exit('刪除失敗!');
}
} elseif ($act == 'next_page') {
require_once QISHI_ROOT_PATH . 'include/mysql.class.php';
$db = new mysql($dbhost, $dbuser, $dbpass, $dbname);
//試卷id
$id = $_REQUEST['id'] ? intval($_REQUEST['id']) : 0;
//試卷信息
$peper_sql = "SELECT * FROM " . table('evaluation_paper') . " WHERE id=" . $id;
$paper_info = $db->getone($peper_sql);
$smarty->assign('paper_info', $paper_info);
//測題信息
$perpage = 10;
$total_sql = "SELECT COUNT(*) AS num from " . table('evaluation_question') . " WHERE paper_id=" . $id;
$total_val = $db->get_total($total_sql);
$page_num = ceil($total_val / $perpage);
//點擊上一頁
if ($_REQUEST['pre_page']) {
$page = $_REQUEST['page'] ? intval($_REQUEST['page']) - 1 : 2;
$offset = ($page - 1) * $perpage;
$smarty->assign('page', $page);
$smarty->assign('next_page', 1);
if ($page != 1) {
$smarty->assign('pre_page', 1);
}
} else {
$page = $_REQUEST['page'] ? intval($_REQUEST['page']) + 1 : 2;
if ($page != $page_num) {
$smarty->assign('next_page', 1);
}
示例4: exit
$user_points = get_user_points($_SESSION['uid']);
if ($points_rule['jobs_add']['type'] == "2" && $points_rule['jobs_add']['value'] > 0) {
$total = $points_rule['jobs_add']['value'];
if ($total > $user_points) {
exit("你的" . $_CFG['points_byname'] . "不足,請充值後再發布!");
}
}
} elseif ($add_mode == '2') {
$setmeal = get_user_setmeal($_SESSION['uid']);
if ($setmeal['endtime'] < time() && $setmeal['endtime'] != "0") {
exit("您的服務已經到期,請重新開通");
}
/*
顯示中的職位(審核通過,審核中,未暫停)
*/
$jobs_num = $db->get_total("select count(*) num from " . table("jobs") . " where uid={$_SESSION['uid']} and audit=1 and display=1 ");
$jobs_tmp_num = $db->get_total("select count(*) num from " . table("jobs_tmp") . " where uid={$_SESSION['uid']} and audit=2 and display=1 ");
$com_jobs_num = $jobs_num + $jobs_tmp_num;
if ($com_jobs_num >= $setmeal['jobs_ordinary']) {
exit("當前顯示的職位已經超過了最大限製,請升級服務套餐!");
}
}
exit("1");
} else {
exit("2");
//header("Location: user.php?act=company_info_add");
}
} elseif ($act == "jobs_add") {
$smarty->cache = false;
$company_info = get_company(intval($_SESSION['uid']));
if ($company_info['companyname']) {
示例5: intval
$company_id = $_GET['company_id'] ? intval($_GET['company_id']) : "";
$vip_menu = $_GET['vip_menu'] ? intval($_GET['vip_menu']) : "";
if ($act == "index") {
// 企業信息
if ($company_id > 0) {
//插入訪問記錄(1->訪問 2->點讚 3->分享)
$insetarr['company_id'] = $company_id;
$insetarr['uid'] = $_SESSION['uid'];
$insetarr['click_type'] = 1;
$insetarr['addtime'] = strtotime(date("Y-m-d"));
$insetarr['ip'] = getip();
$db->inserttable(table('company_praise'), $insetarr);
$company_info = $db->getone("SELECT * from " . table("company_profile") . " where id={$company_id} limit 1");
$company_info['contents'] = htmlspecialchars_decode($company_info['contents'], ENT_QUOTES);
//統計點讚數
$praise = $db->get_total("SELECT COUNT(*) AS num FROM " . table('company_praise') . " WHERE company_id={$company_id} AND click_type=2 ");
$company_info['wzp_click'] = $praise;
if ($company_info['logo']) {
$company_info['logo'] = $_CFG['site_domain'] . $_CFG['site_dir'] . 'data/logo/' . $company_info['logo'];
} else {
$company_info['logo'] = $_CFG['site_domain'] . $_CFG['site_dir'] . 'data/logo/no_logo.gif';
}
$smarty->assign('company_info', $company_info);
if (empty($company_info)) {
$smarty->display("m/m-wzp_error.html");
} else {
// 企業自己訪問出現菜單
if ($vip_menu == "1") {
$smarty->assign('show_menue', 1);
}
// 企業職位
示例6: date
$resume_info['age'] = date("Y") - $resume_info['birthday'];
$smarty->assign('resume_info', $resume_info);
$smarty->display("wap/personal/wap-user-personal-index.html");
}
} elseif ($act == 'favorites') {
$perpage = 5;
$count = 0;
$page = empty($_GET['page']) ? 1 : intval($_GET['page']);
if ($page < 1) {
$page = 1;
}
$theurl = "wap_user.php?act=favorites";
$start = ($page - 1) * $perpage;
$wheresql = " WHERE f.personal_uid='{$_SESSION['uid']}' ";
$total_sql = "SELECT COUNT(*) AS num FROM " . table('personal_favorites') . " AS f {$wheresql} ";
$count = $db->get_total($total_sql);
$joinsql = " LEFT JOIN " . table('jobs') . " as j ON f.jobs_id=j.id ";
$smarty->assign('favorites', get_favorites($start, $perpage, $joinsql . $wheresql));
$smarty->assign('pagehtml', wapmulti($count, $perpage, $page, $theurl));
$smarty->display('wap/personal/wap-collect.html');
} elseif ($act == 'add_favorites') {
$id = isset($_POST['id']) ? intval($_POST['id']) : exit("err");
if (intval($_SESSION['utype'] != 2)) {
exit("個人會員請登錄後收藏職位");
} elseif (add_favorites($id, intval($_SESSION['uid'])) == 0) {
exit("收藏夾中已經存在此職位");
} else {
exit("ok");
}
} elseif ($act == "make_resume") {
$smarty->cache = false;
示例7: table
$smarty->cache = false;
//顧問信息
$member_info = get_user_info(intval($_SESSION['uid']));
if (intval($member_info['consultant']) > 0) {
$consultant = $db->getone("SELECT * FROM " . table('consultant') . " WHERE id=" . intval($member_info['consultant']));
$smarty->assign('consultant', $consultant);
}
$smarty->display("m/company/m-setmealproduct.html");
} elseif ($act == 'setmeal_surplus') {
$smarty->cache = false;
//賬戶狀態
$user_setmeal = get_user_setmeal(intval($_SESSION['uid']));
$smarty->assign('user_setmeal', $user_setmeal);
//剩餘發布職位數 發布的招聘職位 = 發布中的 + 待審核的
$jobs = "SELECT COUNT(*) AS num FROM " . table('jobs') . " where uid='{$_SESSION['uid']}'";
$jobs_num = $db->get_total($jobs);
$jobs_tmp = "SELECT COUNT(*) AS num FROM " . table('jobs_tmp') . " where uid='{$_SESSION['uid']}' and audit=2 ";
$jobs_tmp_num = $db->get_total($jobs_tmp);
$smarty->assign('jobs_num', intval($user_setmeal['jobs_ordinary']) - (intval($jobs_num) + intval($jobs_tmp_num)));
//人才庫容量
$favorites = "SELECT COUNT(*) AS num FROM " . table('company_favorites') . " where company_uid='{$_SESSION['uid']}'";
$favorites_num = $db->get_total($favorites);
$favorites_num = intval($user_setmeal['talent_pool']) - intval($favorites_num);
$smarty->assign('favorites_num', intval($favorites_num));
$smarty->display("m/company/m-setmeal-margin.html");
} elseif ($act == "company_auth") {
$company_profile = get_company($_SESSION['uid']);
$smarty->assign('company_profile', $company_profile);
$smarty->display("m/company/m-enterprise-authenticate.html");
} elseif ($act == "company_auth_save") {
require_once QISHI_ROOT_PATH . 'include/upload.php';