本文整理汇总了PHP中group::updateDB方法的典型用法代码示例。如果您正苦于以下问题:PHP group::updateDB方法的具体用法?PHP group::updateDB怎么用?PHP group::updateDB使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类group
的用法示例。
在下文中一共展示了group::updateDB方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: group
/******************************************************************************
* handle group adding backend here
******************************************************************************/
if (count($_REQUEST[group]) && ($_REQUEST[newgroup] || $_REQUEST[groupname])) {
// they chose a group
if (!$_REQUEST[newgroup]) {
$_REQUEST[newgroup] = $_REQUEST[groupname];
}
if (ereg("^[a-zA-Z0-9_-]{1,20}\$", $_REQUEST[newgroup])) {
$groupObj = new group($_REQUEST[newgroup], $_SESSION[auser]);
if (group::exists($_REQUEST[newgroup])) {
// already exists
if ($groupObj->fetchFromDB()) {
$groupObj->addClasses($_REQUEST[group]);
$groupObj->updateDB();
$list = implode(",", $groupObj->classes);
log_entry("classgroups", "{$_SESSION['auser']} updated {$_REQUEST['newgroup']} to be {$list}", "NULL", $groupObj->id, "classgroup");
} else {
$groupAddError = "Somebody has already created a class group with that name. Please try another name.";
}
} else {
// new group
$groupObj->addClasses($_REQUEST[group]);
$groupObj->updateDB();
log_entry("classgroups", "{$_SESSION['auser']} added {$_REQUEST['newgroup']} with " . implode(",", $groupObj->classes), "NULL", $groupObj->id, "classgroup");
}
} else {
$groupAddError = "Your group name is invalid. It may only contain alphanumeric characters, '_', '-', and be under 21 characters. No spaces, punctuation, etc.";
}
}