本文整理汇总了PHP中update_record函数的典型用法代码示例。如果您正苦于以下问题:PHP update_record函数的具体用法?PHP update_record怎么用?PHP update_record使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了update_record函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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);
}
}
}
示例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);
}
示例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);
}
示例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']);
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}