本文整理汇总了PHP中mysql::updatetable方法的典型用法代码示例。如果您正苦于以下问题:PHP mysql::updatetable方法的具体用法?PHP mysql::updatetable怎么用?PHP mysql::updatetable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mysql
的用法示例。
在下文中一共展示了mysql::updatetable方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: exit
require_once QISHI_ROOT_PATH . 'include/fun_company.php';
$user = get_user_info($_SESSION['uid']);
if ($user['status'] == "2") {
exit('<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tableall">
<tr>
<td width="20" align="right"></td>
<td>
您的账号处于暂停状态,请联系管理员设为正常后进行操作!
</td>
</tr>
</table>');
}
$resume_id = $_REQUEST['resume_id'] ? intval($_REQUEST['resume_id']) : exit("简历ID丢失!");
$setarr['resume_state'] = $_REQUEST['resume_state'] ? intval($_REQUEST['resume_state']) : exit("标记状态错误!");
$setarr['resume_state_cn'] = $_REQUEST['resume_state_cn'] ? iconv('utf-8', 'gbk', trim($_REQUEST['resume_state_cn'])) : exit("标记状态错误!");
$p_uid = $db->getone("SELECT uid FROM " . table('resume') . " WHERE id={$resume_id} LIMIT 1 ");
$uid = intval($_SESSION['uid']);
$row = $db->getone("select resume_id from " . table("company_label_resume") . " where uid={$uid} and resume_id={$resume_id} limit 1");
if (empty($row)) {
$setarr['resume_id'] = $resume_id;
$setarr['uid'] = $uid;
$setarr['personal_uid'] = $p_uid['uid'];
$db->inserttable(table('company_label_resume'), $setarr);
//将查看状态更新成已经查看
$db->updatetable(table('personal_jobs_apply'), array('personal_look' => '2', 'is_reply' => $setarr['resume_state']), array("company_uid" => $uid, "resume_id" => $resume_id));
} else {
$db->updatetable(table('company_label_resume'), $setarr, array("uid" => $uid, "resume_id" => $resume_id));
//将查看状态更新成已经查看
$db->updatetable(table('personal_jobs_apply'), array('personal_look' => '2', 'is_reply' => $setarr['resume_state']), array("company_uid" => $uid, "resume_id" => $resume_id));
}
exit("ok");
示例2: trim
$setsqlarr['detailed'] = trim($_POST['detailed']);
$setsqlarr['refreshtime'] = time();
$days = intval($_POST['days']);
if ($days > 0) {
$time = $info['deadline'] > time() ? $info['deadline'] : time();
$setsqlarr['deadline'] = strtotime("{$days} day", $time);
}
$setsqlarr['likekey'] = $setsqlarr['jobname'] . "," . $setsqlarr['comname'] . "," . $setsqlarr['address'] . "," . $setsqlarr['detailed'];
require_once QISHI_ROOT_PATH . 'include/splitword.class.php';
$sp = new SPWord();
$setsqlarr['key'] = $setsqlarr['jobname'] . $setsqlarr['comname'] . $setsqlarr['address'] . $setsqlarr['detailed'];
$setsqlarr['key'] = "{$setsqlarr['jobname']} {$setsqlarr['comname']} " . $sp->extracttag($setsqlarr['key']);
$setsqlarr['key'] = $sp->pad($setsqlarr['key']);
$link[0]['text'] = "返回微招聘列表";
$link[0]['href'] = url_rewrite('QS_simplelist');
if ($db->updatetable(table('simple'), $setsqlarr, " id='{$id}' ")) {
if ($_CFG['simple_edit_audit'] > 1) {
$str = ",请等待管理员审核";
}
showmsg("修改成功{$str}!", 2, $link);
} else {
showmsg("修改失败!", 0);
}
} elseif ($act == 'check_tel') {
$tel = $_GET['tel'];
$id = intval($_GET['id']);
if (preg_match("/^\\d*\$/", $tel)) {
if ($id > 0) {
$wheresql = " AND id<>'{$id}'";
}
$sql = "select id from " . table('simple') . " where tel = '{$tel}' {$wheresql} LIMIT 1";
示例3: elseif
$smarty->assign('type', $type);
$smarty->assign('username', $username);
$smarty->display('m/password-set-new.html');
}
} elseif ($act == 'set_pass_save') {
global $QS_pwdhash;
$_POST = array_map("utf8_to_gbk", $_POST);
$username = trim($_POST['username']);
$password = trim($_POST['password']);
$password_two = trim($_POST['password_two']);
if (empty($username) || empty($password) || empty($password_two)) {
exit('信息丢失!');
}
if ($password != $password_two) {
exit('两次输入的密码不同!');
}
if (preg_match("/^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*\$/", $username)) {
$userinfo = get_user_inemail($username);
} elseif (preg_match("/^(13|14|15|17|18)\\d{9}\$/", $username)) {
$userinfo = get_user_inmobile($username);
}
$password_hash = md5(md5($password) . $userinfo['pwd_hash'] . $QS_pwdhash);
$setsqlarr['password'] = $password_hash;
$rst = $db->updatetable(table('members'), $setsqlarr, array("uid" => $userinfo['uid']));
if ($rst) {
exit('ok');
} else {
exit('设置新密码失败!');
}
}
unset($smarty);
示例4: exit
} else {
exit("邮箱配置出错,请联系网站管理员");
}
}
} elseif ($act == "verify_code") {
$verifycode = trim($_POST['verifycode']);
if (empty($verifycode) || empty($_SESSION['email_rand']) || $verifycode != $_SESSION['email_rand']) {
exit("验证码错误");
} else {
$uid = intval($_SESSION['uid']);
if (empty($uid)) {
exit("系统错误,UID丢失!");
} else {
$setsqlarr['email'] = $_SESSION['verify_email'];
$setsqlarr['email_audit'] = 1;
$db->updatetable(table('members'), $setsqlarr, " uid='{$uid}'");
if ($_SESSION['utype'] == "2") {
$infoarr['email'] = $setsqlarr['email'];
$db->updatetable(table('members_info'), $infoarr, " uid='{$uid}'");
$u['email'] = $setsqlarr['email'];
$db->updatetable(table('resume'), $u, " uid='{$uid}'");
// 积分操作
$rule = get_cache('points_rule');
if ($rule['per_verifyemail']['value'] > 0) {
$info = $db->getone("SELECT uid FROM " . table('members_handsel') . " WHERE uid ='{$_SESSION['uid']}' AND htype='per_verifyemail' LIMIT 1");
if (empty($info)) {
$time = time();
$db->query("INSERT INTO " . table('members_handsel') . " (uid,htype,addtime) VALUES ('{$_SESSION['uid']}', 'per_verifyemail','{$time}')");
require_once QISHI_ROOT_PATH . 'include/fun_personal.php';
report_deal($_SESSION['uid'], $rule['per_verifyemail']['type'], $rule['per_verifyemail']['value']);
$user_points = get_user_points($_SESSION['uid']);
示例5: elseif
} elseif ($act == "verify_code") {
$send_key = trim($_POST['send_key']);
if (empty($send_key) || $send_key != $_SESSION['send_mobile_key']) {
exit("链接错误");
}
$verifycode = trim($_POST['verifycode']);
if (empty($verifycode) || empty($_SESSION['mobile_rand']) || $verifycode != $_SESSION['mobile_rand']) {
exit("验证码错误");
} else {
$uid = intval($_SESSION['uid']);
if (empty($uid)) {
exit("系统错误,UID丢失!");
} else {
$setsqlarr['mobile'] = $_SESSION['verify_mobile'];
$setsqlarr['mobile_audit'] = 1;
$db->updatetable(table('members'), $setsqlarr, " uid='{$uid}'");
unset($setsqlarr, $_SESSION['verify_mobile'], $_SESSION['mobile_rand']);
if ($_CFG['operation_mode'] == '1' || $_CFG['operation_mode'] == '3') {
$rule = get_cache('points_rule');
if ($rule['verifymobile']['value'] > 0) {
$info = $db->getone("SELECT uid FROM " . table('members_handsel') . " WHERE uid ='{$_SESSION['uid']}' AND htype='verifymobile' LIMIT 1");
if (empty($info)) {
$time = time();
$db->query("INSERT INTO " . table('members_handsel') . " (uid,htype,addtime) VALUES ('{$_SESSION['uid']}', 'verifymobile','{$time}')");
require_once QISHI_ROOT_PATH . 'include/fun_comapny.php';
report_deal($_SESSION['uid'], $rule['verifymobile']['type'], $rule['verifymobile']['value']);
$user_points = get_user_points($_SESSION['uid']);
$operator = $rule['verifymobile']['type'] == "1" ? "+" : "-";
$_SESSION['handsel_verifymobile'] = $_CFG['points_byname'] . $operator . $rule['verifymobile']['value'];
write_memberslog($_SESSION['uid'], 1, 9001, $_SESSION['username'], " 手机通过验证,{$_CFG['points_byname']}({$operator}{$rule['verifymobile']['value']}),(剩余:{$user_points})", 1, 1016, "手机认证通过", "{$operator}{$rule['verifymobile']['value']}", "{$user_points}");
}
示例6: intval
$setsqlarr['key'] = $sp->pad($setsqlarr['key']);
if ($company_info['audit'] == "1") {
$_CFG['audit_verifycom_editjob'] != "-1" ? $setsqlarr['audit'] = intval($_CFG['audit_verifycom_editjob']) : '';
} else {
$_CFG['audit_unexaminedcom_editjob'] != "-1" ? $setsqlarr['audit'] = intval($_CFG['audit_unexaminedcom_editjob']) : '';
}
$setsqlarr_contact['contact'] = !empty($_POST['contact']) ? trim($_POST['contact']) : exit('您没有填写联系人!');
$setsqlarr_contact['telephone'] = !empty($_POST['telephone']) ? trim($_POST['telephone']) : exit('您没有填写联系电话!');
$setsqlarr_contact['email'] = !empty($_POST['email']) ? trim($_POST['email']) : exit('您没有填写联系邮箱!');
$setsqlarr_contact['address'] = !empty($_POST['address']) ? trim($_POST['address']) : exit('您没有填写详细地址!');
check_word($_CFG['filter'], $_POST['telephone']) ? exit($_CFG['filter_tips']) : '';
$setsqlarr_contact['contact_show'] = 1;
$setsqlarr_contact['email_show'] = 1;
$setsqlarr_contact['telephone_show'] = 1;
$setsqlarr_contact['address_show'] = 1;
if (!$db->updatetable(table('jobs'), $setsqlarr, " id='{$id}' AND uid='{$_SESSION['uid']}' ")) {
exit("err");
}
if (!$db->updatetable(table('jobs_tmp'), $setsqlarr, " id='{$id}' AND uid='{$_SESSION['uid']}' ")) {
exit("err");
}
if (!$db->updatetable(table('jobs_contact'), $setsqlarr_contact, " pid='{$id}' ")) {
exit("err");
}
if ($add_mode == '1') {
if ($points_rule['jobs_edit']['value'] > 0) {
report_deal($_SESSION['uid'], $points_rule['jobs_edit']['type'], $points_rule['jobs_edit']['value']);
$user_points = get_user_points($_SESSION['uid']);
$operator = $points_rule['jobs_edit']['type'] == "1" ? "+" : "-";
write_memberslog($_SESSION['uid'], 1, 9001, $_SESSION['username'], "修改职位:<strong>{$setsqlarr['jobs_name']}</strong>,({$operator}{$points_rule['jobs_edit']['value']}),(剩余:{$user_points})", 1, 1002, "修改招聘信息", "{$operator}{$points_rule['jobs_edit']['value']}", "{$user_points}");
}
示例7: get_user_email
define('IN_QISHI', true);
require_once dirname(__FILE__) . '/../include/common.inc.php';
require_once QISHI_ROOT_PATH . 'include/mysql.class.php';
require_once QISHI_ROOT_PATH . 'include/fun_user.php';
$db = new mysql($dbhost, $dbuser, $dbpass, $dbname);
unset($dbhost, $dbuser, $dbpass, $dbname);
if ($_SESSION['input_token_subscribe'] != "" && $_SESSION['input_token_subscribe'] == $_POST['input_token_subscribe']) {
$setsqlarr['email'] = trim($_POST['email']) ? trim($_POST['email']) : showmsg("请填写接收邮箱!", 1);
$setsqlarr['search_name'] = trim($_POST['search_name']);
$setsqlarr['district'] = trim($_POST['district_id']);
$setsqlarr['district_cn'] = trim($_POST['district_cn']) ? trim($_POST['district_cn']) : showmsg("请填写意向地区!", 1);
$setsqlarr['days'] = intval($_POST['days']) ? intval($_POST['days']) : showmsg("请选择发送周期!", 1);
$setsqlarr['addtime'] = time();
$ck_email = get_user_email(strtolower($_POST['email']));
if ($ck_email) {
$db->updatetable(table('jobs_subscribe'), $setsqlarr, " email='" . strtolower($_POST['email']) . "' ");
} else {
$insertid = $db->inserttable(table('jobs_subscribe'), $setsqlarr);
}
send_subscribe_jobs($setsqlarr);
$link[0]['text'] = "返回";
$link[0]['href'] = 'index.php';
showmsg("恭喜您订阅成功!", 2, $link);
} else {
showmsg("非法操作!", 1);
}
function get_user_email($email)
{
global $db;
$ck_email = $db->getone("select 1 from " . table('jobs_subscribe') . " where email='" . $email . "'");
return $ck_email;
示例8: elseif
// var_dump($company_tag);die;
$smarty->assign('company_tag', $company_tagarr['id']);
$smarty->assign('title', $company_info['companyname'] . " - 企业福利 ");
$smarty->display("m/m-wzp_welfare.html");
}
} else {
$smarty->display("m/m-wzp_error.html");
}
} elseif ($act == "company_welfare_add") {
$setarr['tag'] = ltrim($_GET['tag'], ",");
if ($company_id > 0) {
$company_info = $db->getone("SELECT * from " . table("company_profile") . " where id={$company_id} limit 1");
if ($company_info["uid"] != $_SESSION['uid']) {
exit("err");
}
$db->updatetable(table('company_profile'), $setarr, array('id' => $company_id, 'uid' => $_SESSION['uid'])) ? exit("ok") : exit("err");
} else {
exit('err');
}
} elseif ($act == "company_tpl") {
// 企业信息
if ($company_id > 0) {
$company_info = $db->getone("SELECT * from " . table("company_profile") . " where id={$company_id} limit 1");
$smarty->assign('company_info', $company_info);
if (empty($company_info) || $company_info['uid'] != $_SESSION['uid']) {
header("location:login.php");
} else {
$smarty->assign('title', $company_info['companyname'] . " - 模版 ");
$smarty->display("m/m-wzp_tpl.html");
}
} else {
示例9: trim
$setsqlarr['email'] = trim($_POST['email']) ? trim($_POST['email']) : exit('请填写联系邮箱!');
$setsqlarr['website'] = trim($_POST['website']);
$setsqlarr['contents'] = trim($_POST['contents']) ? trim($_POST['contents']) : exit('请填写公司简介!');
$setsqlarr['contact_show'] = 1;
$setsqlarr['email_show'] = 1;
$setsqlarr['telephone_show'] = 1;
$setsqlarr['address_show'] = 1;
if ($_CFG['company_repeat'] == "0") {
$info = $db->getone("SELECT uid FROM " . table('company_profile') . " WHERE companyname ='{$setsqlarr['companyname']}' AND uid<>'{$_SESSION['uid']}' LIMIT 1");
if (!empty($info)) {
exit("{$setsqlarr['companyname']}已经存在,同公司信息不能重复注册");
}
}
if ($company_info) {
$_CFG['audit_edit_com'] != "-1" ? $setsqlarr['audit'] = intval($_CFG['audit_edit_com']) : '';
if ($db->updatetable(table('company_profile'), $setsqlarr, " uid={$_SESSION['uid']}")) {
$jobarr['companyname'] = $setsqlarr['companyname'];
$jobarr['trade'] = $setsqlarr['trade'];
$jobarr['trade_cn'] = $setsqlarr['trade_cn'];
$jobarr['scale'] = $setsqlarr['scale'];
$jobarr['scale_cn'] = $setsqlarr['scale_cn'];
$jobarr['street'] = $setsqlarr['street'];
$jobarr['street_cn'] = $setsqlarr['street_cn'];
if (!$db->updatetable(table('jobs'), $jobarr, " uid=" . $setsqlarr['uid'] . "")) {
exit('修改公司名称出错!');
}
if (!$db->updatetable(table('jobs_tmp'), $jobarr, " uid=" . $setsqlarr['uid'] . "")) {
exit('修改公司名称出错!');
}
$soarray['trade'] = $jobarr['trade'];
$soarray['scale'] = $jobarr['scale'];
示例10: intval
$setsqlarr['uid'] = intval($_SESSION['uid']);
$setsqlarr['fullname'] = trim($_POST['fullname']) ? trim($_POST['fullname']) : exit("请填写真实姓名");
$setsqlarr['display_name'] = intval($_POST['display_name']);
$setsqlarr['sex'] = trim($_POST['sex']) ? trim($_POST['sex']) : exit("请选择性别");
$setsqlarr['sex_cn'] = trim($_POST['sex_cn']) ? trim($_POST['sex_cn']) : exit("请选择性别");
$setsqlarr['birthdate'] = intval($_POST['birthdate']) ? intval($_POST['birthdate']) : exit("请选择出生年份");
$setsqlarr['residence'] = trim($_POST['residence']) ? trim($_POST['residence']) : exit("请选择现居住地");
$setsqlarr['residence'] = trim($_POST['residence']) ? trim($_POST['residence']) : exit("请选择现居住地");
$setsqlarr['education'] = intval($_POST['education']) ? intval($_POST['education']) : exit("请选择获得学历");
$setsqlarr['education_cn'] = trim($_POST['education_cn']) ? trim($_POST['education_cn']) : exit("请选择获得学历");
$setsqlarr['experience'] = intval($_POST['experience']) ? intval($_POST['experience']) : exit("请选择工作经验");
$setsqlarr['experience_cn'] = trim($_POST['experience_cn']) ? trim($_POST['experience_cn']) : exit("请选择工作经验");
$setsqlarr['email'] = trim($_POST['email']) ? trim($_POST['email']) : exit("请填写邮箱");
$setsqlarr['email_notify'] = $_POST['email_notify'] == "1" ? 1 : 0;
$setsqlarr['telephone'] = trim($_POST['telephone']) ? trim($_POST['telephone']) : exit("请填写手机");
$db->updatetable(table('resume'), $setsqlarr, " id='" . intval($_POST['pid']) . "' AND uid='{$setsqlarr['uid']}'");
check_resume($_SESSION['uid'], intval($_REQUEST['pid']));
if ($_CFG['audit_edit_resume'] != "-1") {
set_resume_entrust(intval($_REQUEST['pid']));
}
write_memberslog($_SESSION['uid'], 2, 1105, $_SESSION['username'], "修改了简历({$_POST['title']})");
$infoarr['realname'] = $setsqlarr['fullname'];
$infoarr['sex'] = $setsqlarr['sex'];
$infoarr['sex_cn'] = $setsqlarr['sex_cn'];
$infoarr['birthday'] = $setsqlarr['birthdate'];
$infoarr['residence'] = $setsqlarr['residence'];
$infoarr['residence'] = $setsqlarr['residence'];
$infoarr['education'] = $setsqlarr['education'];
$infoarr['education_cn'] = $setsqlarr['education_cn'];
$infoarr['experience'] = $setsqlarr['experience'];
$infoarr['experience_cn'] = $setsqlarr['experience_cn'];
示例11: trim
}
$setsqlarr['email'] = trim($_POST['email']) ? trim($_POST['email']) : exit('请填写联系邮箱!');
$setsqlarr['contents'] = trim($_POST['contents']) ? trim($_POST['contents']) : exit('请填写公司简介!');
$setsqlarr['contact_show'] = 1;
$setsqlarr['email_show'] = 1;
$setsqlarr['telephone_show'] = 1;
$setsqlarr['address_show'] = 1;
if ($_CFG['company_repeat'] == "0") {
$info = $db->getone("SELECT uid FROM " . table('company_profile') . " WHERE companyname ='{$setsqlarr['companyname']}' AND uid<>'{$_SESSION['uid']}' LIMIT 1");
if (!empty($info)) {
exit("{$setsqlarr['companyname']}已经存在,同公司信息不能重复注册");
}
}
if ($company_info) {
$_CFG['audit_edit_com'] != "-1" ? $setsqlarr['audit'] = intval($_CFG['audit_edit_com']) : '';
if ($db->updatetable(table('company_profile'), $setsqlarr, " uid={$_SESSION['uid']}")) {
$jobarr['companyname'] = $setsqlarr['companyname'];
$jobarr['trade'] = $setsqlarr['trade'];
$jobarr['trade_cn'] = $setsqlarr['trade_cn'];
$jobarr['scale'] = $setsqlarr['scale'];
$jobarr['scale_cn'] = $setsqlarr['scale_cn'];
$jobarr['street'] = $setsqlarr['street'];
$jobarr['street_cn'] = $setsqlarr['street_cn'];
if (!$db->updatetable(table('jobs'), $jobarr, " uid=" . $setsqlarr['uid'] . "")) {
exit('修改公司名称出错!');
}
if (!$db->updatetable(table('jobs_tmp'), $jobarr, " uid=" . $setsqlarr['uid'] . "")) {
exit('修改公司名称出错!');
}
if (!$db->updatetable(table('jobfair_exhibitors'), array('companyname' => $setsqlarr['companyname']), " uid=" . $setsqlarr['uid'] . "")) {
exit('修改公司名称出错!');