本文整理汇总了PHP中update_record函数的典型用法代码示例。如果您正苦于以下问题:PHP update_record函数的具体用法?PHP update_record怎么用?PHP update_record使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了update_record函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: econsole_update_instance
/**
* Given an object containing all the necessary data,
* (defined by the form in mod.html) this function
* will update an existing instance with new data.
*
* @param object $instance An object from the form in mod.html
* @return boolean Success/Fail
**/
function econsole_update_instance($econsole)
{
$econsole->timemodified = time();
$econsole->id = $econsole->instance;
# May have to add extra stuff in here #
return update_record("econsole", $econsole);
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:15,代码来源:lib.php
示例2: process_data
/**
* TODO comment this
*/
function process_data($data)
{
global $CFG, $USER;
foreach ($data->unit as $idx => $v) {
$qual = get_record('ilp_qual_units', 'UniqueReferenceNumber', $idx, 'courseid', $data->course_id);
if (empty($qual)) {
$course = get_record('course', 'id', $data->course_id);
$qualificationunits = $this->db->return_table_values('ofqual_qualification_units', array('UniqueReferenceNumber' => array('=' => "'{$idx}'"), 'qualificationid' => array('=' => "'{$course->idnumber}'")));
if (!empty($qualificationunits)) {
$qual = new stdClass();
$q = $qualificationunits[0];
$qual->courseid = $data->course_id;
//$qual->academic_year = $q['academic_year'];
$qual->qualificationid = $q['QualificationID'];
$qual->UniqueReferenceNumber = $q['UniqueReferenceNumber'];
$qual->title = $q['Title'];
$qual->unitownerreference = $q['UnitOwnerReference'];
$qual->selected = !empty($v) ? 1 : 0;
$qual->title = mysql_real_escape_string($qual->title);
$qual->title = str_replace("'", "", $qual->title);
insert_record('ilp_qual_units', $qual);
}
} else {
$qual->title = mysql_real_escape_string($qual->title);
$qual->title = str_replace("'", "", $qual->title);
$qual->selected = !empty($v) ? 1 : 0;
update_record('ilp_qual_units', $qual);
}
}
}
开发者ID:nigeldaley,项目名称:hrc_ilp_qual_unit,代码行数:33,代码来源:unitselection_mform.php
示例3: deletepost_submit
function deletepost_submit(Pieform $form, $values)
{
global $SESSION, $USER;
$objectionable = get_record_sql("SELECT fp.id\n FROM {interaction_forum_post} fp\n JOIN {objectionable} o\n ON (o.objecttype = 'forum' AND o.objectid = fp.id)\n WHERE fp.id = ?\n AND o.resolvedby IS NULL\n AND o.resolvedtime IS NULL", array($values['post']));
if ($objectionable !== false) {
// Trigger activity.
$data = new StdClass();
$data->postid = $values['post'];
$data->message = '';
$data->reporter = $USER->get('id');
$data->ctime = time();
$data->event = DELETE_OBJECTIONABLE_POST;
activity_occurred('reportpost', $data, 'interaction', 'forum');
}
update_record('interaction_forum_post', array('deleted' => 1), array('id' => $values['post']));
$SESSION->add_ok_msg(get_string('deletepostsuccess', 'interaction.forum'));
// Figure out which parent record to redirect us to. If the parent record is deleted,
// keep moving up the chain until you find one that's not deleted.
$postrec = new stdClass();
$postrec->parent = $values['parent'];
do {
$postrec = get_record('interaction_forum_post', 'id', $postrec->parent, null, null, null, null, 'id, deleted, parent');
} while ($postrec && $postrec->deleted && $postrec->parent);
$redirecturl = get_config('wwwroot') . 'interaction/forum/topic.php?id=' . $values['topic'];
if ($postrec && $postrec->parent) {
$redirecturl .= '&post=' . $postrec->id;
}
redirect($redirecturl);
}
开发者ID:rboyatt,项目名称:mahara,代码行数:29,代码来源:deletepost.php
示例4: deva_update_instance
/**
* Given an object containing all the necessary data,
* (defined by the form in mod_form.php) this function
* will update an existing instance with new data.
*
* @param object $deva An object from the form in mod_form.php
* @return boolean Success/Fail
*/
function deva_update_instance($deva)
{
$deva->timemodified = time();
$deva->id = $deva->instance;
# You may have to add extra stuff in here #
return update_record('deva', $deva);
}
开发者ID:arshanam,项目名称:Moodle-ITScholars-LMS,代码行数:15,代码来源:lib.php
示例5: deletepost_submit
function deletepost_submit(Pieform $form, $values)
{
global $SESSION;
update_record('interaction_forum_post', array('deleted' => 1), array('id' => $values['post']));
$SESSION->add_ok_msg(get_string('deletepostsuccess', 'interaction.forum'));
redirect('/interaction/forum/topic.php?id=' . $values['topic'] . '#post' . $values['parent']);
}
开发者ID:Br3nda,项目名称:mahara,代码行数:7,代码来源:deletepost.php
示例6: poodllpairwork_update_instance
/**
* Given an object containing all the necessary data,
* (defined by the form in mod.html) this function
* will update an existing instance with new data.
*
* @param object $instance An object from the form in mod.html
* @return boolean Success/Fail
**/
function poodllpairwork_update_instance($pairwork)
{
$pairwork->timemodified = time();
$pairwork->id = $pairwork->instance;
# May have to add extra stuff in here #
return update_record("poodllpairwork", $pairwork);
}
开发者ID:laiello,项目名称:poodll,代码行数:15,代码来源:lib.php
示例7: jeliot_update_instance
/**
* Given an object containing all the necessary data,
* (defined by the form in mod.html) this function
* will update an existing instance with new data.
*
* @param object $instance An object from the form in mod.html
* @return boolean Success/Fail
**/
function jeliot_update_instance($jeliot)
{
$jeliot->timemodified = time();
$jeliot->id = $jeliot->instance;
# May have to add extra stuff in here #
return update_record("jeliot", $jeliot);
}
开发者ID:chriscaragianis,项目名称:jeliot3,代码行数:15,代码来源:lib.php
示例8: xmldb_blocktype_openbadgedisplayer_upgrade
function xmldb_blocktype_openbadgedisplayer_upgrade($oldversion = 0)
{
if ($oldversion < 2015062301) {
$blocks = get_records_array('block_instance', 'blocktype', 'openbadgedisplayer');
if (is_array($blocks)) {
foreach ($blocks as $block) {
$configdata = unserialize($block->configdata);
if (isset($configdata['badgegroup'])) {
// Append source to legacy values
if (is_string($configdata['badgegroup'])) {
$configdata['badgegroup'] = 'backpack:' . $configdata['badgegroup'];
} else {
if (is_array($configdata['badgegroup'])) {
foreach ($configdata['badgegroup'] as &$group) {
$group = str_replace('https://openbadgepassport.com/', 'passport', $group);
$group = str_replace('https://backpack.openbadges.org/', 'backpack', $group);
}
}
}
$block->configdata = serialize($configdata);
update_record('block_instance', $block, 'id');
}
}
}
}
return true;
}
开发者ID:ninelanterns,项目名称:mahara-openbadgedisplayer,代码行数:27,代码来源:upgrade.php
示例9: flv_update_instance
/**
* Given an object containing all the necessary data,
* (defined by the form in mod.html) this function
* will update an existing instance with new data.
*
* @param object $instance An object from the form in mod.html
* @return boolean Success/Fail
**/
function flv_update_instance($flv)
{
$flv->timemodified = time();
$flv->id = $flv->instance;
# May have to add extra stuff in here #
return update_record("flv", $flv);
}
开发者ID:kai707,项目名称:ITSA-backup,代码行数:15,代码来源:lib.php
示例10: quotasystem_update_instance
/**
* Given an object containing all the necessary data,
* (defined by the form in mod_form.php) this function
* will update an existing instance with new data.
*
* @param object $quotasystem An object from the form in mod_form.php
* @return boolean Success/Fail
*/
function quotasystem_update_instance($quotasystem)
{
$quotasystem->timemodified = time();
$quotasystem->id = $quotasystem->instance;
# You may have to add extra stuff in here #
return update_record('quotasystem', $quotasystem);
}
开发者ID:arshanam,项目名称:Moodle-ITScholars-LMS,代码行数:15,代码来源:lib.php
示例11: ejercicios_update_instance
/**
* Given an object containing all the necessary data,
* (defined by the form in mod_form.php) this function
* will update an existing instance with new data.
*
* @param object $ejercicios An object from the form in mod_form.php
* @return boolean Success/Fail
*/
function ejercicios_update_instance($ejercicios)
{
$ejercicios->timemodified = time();
$ejercicios->id = $ejercicios->instance;
# You may have to add extra stuff in here #
return update_record('ejercicios', $ejercicios);
}
开发者ID:cagmi,项目名称:ejerciciosVIP,代码行数:15,代码来源:lib.php
示例12: casecourseware_update_instance
/**
* Given an object containing all the necessary data,
* (defined by the form in mod_form.php) this function
* will update an existing instance with new data.
*
* @param object $casecourseware An object from the form in mod_form.php
* @return boolean Success/Fail
*/
function casecourseware_update_instance($casecourseware)
{
$casecourseware->timemodified = time();
$casecourseware->id = $casecourseware->instance;
# You may have to add extra stuff in here #
return update_record('casecourseware', $casecourseware);
}
开发者ID:nagyistoce,项目名称:moodle-Teach-Pilot,代码行数:15,代码来源:lib.php
示例13: swf_update_instance
/**
* Given an object containing all the necessary data,
* (defined by the form in mod.html) this function
* will update an existing instance with new data.
*
* @param object $instance An object from the form in mod.html
* @return boolean Success/Fail
**/
function swf_update_instance($swf)
{
$swf->timemodified = time();
$swf->id = $swf->instance;
# May have to add extra stuff in here #
return update_record("swf", $swf);
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:15,代码来源:lib.php
示例14: studynotes_update_instance
/**
* Given an object containing all the necessary data,
* (defined by the form in mod.html) this function
* will update an existing instance with new data.
*
* @param object $instance An object from the form in mod.html
* @return boolean Success/Fail
**/
function studynotes_update_instance($studynotes)
{
$studynotes->timemodified = time();
$studynotes->id = $studynotes->instance;
# May have to add extra stuff in here #
return update_record("studynotes", $studynotes);
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:15,代码来源:lib.php
示例15: slideshow_update_instance
/**
* Given an object containing all the necessary data,
* (defined by the form in mod.html) this function
* will update an existing instance with new data.
*
* @param object $instance An object from the form in mod.html
* @return boolean Success/Fail
**/
function slideshow_update_instance($slideshow)
{
$slideshow->timemodified = time();
$slideshow->id = $slideshow->instance;
# May have to add extra stuff in here #
return update_record("slideshow", $slideshow);
}
开发者ID:e-rasvet,项目名称:slideshow,代码行数:15,代码来源:lib.php
示例16: ouwiki_update_instance
function ouwiki_update_instance($ouwiki)
{
global $CFG;
$ok = true;
$ouwiki->id = $ouwiki->instance;
// Set up null values
$nullvalues = array('editbegin', 'editend', 'timeout');
foreach ($nullvalues as $nullvalue) {
if (empty($ouwiki->{$nullvalue})) {
unset($ouwiki->{$nullvalue});
$ok &= execute_sql("UPDATE {$CFG->prefix}ouwiki SET {$nullvalue}=NULL WHERE id={$ouwiki->id}", false);
}
}
if (strlen(preg_replace('/(<.*?>)|(&.*?;)|\\s/', '', $ouwiki->summary)) == 0) {
unset($ouwiki->summary);
$ok &= execute_sql("UPDATE {$CFG->prefix}ouwiki SET summary=NULL WHERE id={$ouwiki->id}", false);
}
ouwiki_check_groups($ouwiki);
// insitu editing
if (class_exists('ouflags') && has_capability('local/course:revisioneditor', get_context_instance(CONTEXT_COURSE, $ouwiki->course), null, false)) {
include_once $CFG->dirroot . '/local/insitu/lib.php';
return oci_mod_make_backup_and_save_instance($ouwiki);
}
// Update main record
$ok &= update_record("ouwiki", $ouwiki);
return $ok;
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:27,代码来源:lib.php
示例17: mplayer_update_instance
/**
* Given an object containing all the necessary data,
* (defined by the form in mod.html) this function
* will update an existing instance with new data.
*
* @param object $instance An object from the form in mod.html
* @return boolean Success/Fail
**/
function mplayer_update_instance($mplayer)
{
$mplayer->timemodified = time();
$mplayer->id = $mplayer->instance;
# May have to add extra stuff in here #
return update_record("mplayer", $mplayer);
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:15,代码来源:lib.php
示例18: tab_update_instance
/**
* Given an object containing all the necessary data,
* (defined by the form in mod.html) this function
* will update an existing instance with new data.
*
* @param object $instance An object from the form in mod.html
* @return boolean Success/Fail
**/
function tab_update_instance($tab)
{
$tab->timemodified = time();
$tab->id = $tab->instance;
# May have to add extra stuff in here #
return update_record("tab", $tab);
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:15,代码来源:lib.php
示例19: submitview_submit
function submitview_submit(Pieform $form, $values)
{
global $SESSION, $viewid, $groupid;
update_record('view', array('submittedgroup' => $groupid), array('id' => $viewid));
$SESSION->add_ok_msg(get_string('viewsubmitted', 'view'));
redirect('/view/');
}
开发者ID:Br3nda,项目名称:mahara,代码行数:7,代码来源:submit.php
示例20: shoppingcart_update_instance
/**
* Given an object containing all the necessary data,
* (defined by the form in mod_form.php) this function
* will update an existing instance with new data.
*
* @param object $shoppingcart An object from the form in mod_form.php
* @return boolean Success/Fail
*/
function shoppingcart_update_instance($shoppingcart)
{
$shoppingcart->timemodified = time();
$shoppingcart->id = $shoppingcart->instance;
# You may have to add extra stuff in here #
return update_record('shoppingcart', $shoppingcart);
}
开发者ID:jhena005,项目名称:vlabsdevelopment,代码行数:15,代码来源:lib.php
注:本文中的update_record函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论