本文整理匯總了PHP中DBModel::updateDB方法的典型用法代碼示例。如果您正苦於以下問題:PHP DBModel::updateDB方法的具體用法?PHP DBModel::updateDB怎麽用?PHP DBModel::updateDB使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DBModel
的用法示例。
在下文中一共展示了DBModel::updateDB方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: go_on
/**
* Team statecode += 1
* @param string team id
*/
public function go_on($team_id)
{
$team = DBModel::getTeamDetail($team_id);
$cond['id'] = $team['team']['id'];
$data['statecode'] = (int) $team['team']['statecode'] + 1;
DBModel::updateDB('cernet_team', $cond, $data);
foreach ($team['teammate'] as $k => $v) {
$cond = $_data = array();
$_data['statecode'] = $data['statecode'];
$cond['id'] = $v['id'];
DBModel::updateDB('cernet_user', $cond, $_data);
}
}
示例2: nopassword_
/**
* Password find back handle function.
* Usertype: Student
*/
public function nopassword_()
{
try {
require 'powerdream/Common/Mail.class.php';
$cond['email'] = xassert(safepost('email'), Error('post'));
$random = rand(0, 100) . ' This is a salt.';
$pwd = substr(encrypt($random), 0, 8);
$data['password'] = encrypt($pwd);
if (!DBModel::existUser('cernet_user', $cond)) {
$this->error(Error('email'), lastpage());
} else {
DBModel::updateDB('cernet_user', $cond, $data);
$user = DBModel::selectDB('cernet_user', $cond);
$user = $user[0];
$mailto = $cond['email'];
$replace['[#password]'] = $pwd;
$replace['[#username]'] = $user['username'];
$content = Mail::contentTemplate('nopassword');
Mail::autosend($mailto, $content, $replace);
$this->success(Success('nopassword'), '__ROOT__');
}
} catch (Exception $e) {
bassert($this, false, $e->getMessage());
}
}
示例3: personal_
public function personal_()
{
eval(USER);
try {
$data = $_POST;
unset($data['__hash__']);
$root = C('ROOT');
if (isset($_FILES["picture"])) {
$upload = uploadImage();
if (!is_string($upload)) {
$data['picture'] = $root . $upload[0]["savepath"] . $upload[0]["savename"];
}
if ($data["picture"] == $root) {
unset($data["picture"]);
}
}
DBModel::updateDB('cernet_user', array('username' => session('username')), $data);
$this->success(Success('modify'), '__ROOT__/User/personal');
} catch (Exception $e) {
throw_exception($e->getMessage());
}
}
示例4: teacher_
public function teacher_()
{
eval(ADMIN);
$userId = $_GET['show'];
$data = $_POST;
unset($data['__hash__']);
$root = C('ROOT');
DBModel::updateDB('cernet_teacher', array('id' => $userId), $data);
$this->success(Success('modify'));
}