• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP execute_sql函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中execute_sql函数的典型用法代码示例。如果您正苦于以下问题:PHP execute_sql函数的具体用法?PHP execute_sql怎么用?PHP execute_sql使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了execute_sql函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: 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


示例2: xmldb_artefact_calendar_upgrade

function xmldb_artefact_calendar_upgrade($oldversion = 0)
{
    if ($oldversion < 2013062404) {
        $table = new XMLDBTable('artefact_calendar_reminder');
        drop_table($table);
        $table->addFieldInfo('user', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL);
        $table->addFieldInfo('reminder_type', XMLDB_TYPE_INTEGER, '2', null, XMLDB_NOTNULL);
        $table->addFieldInfo('reminder_date', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null, null, '-1', null);
        $table->addKeyInfo('reminder_pk', XMLDB_KEY_PRIMARY, array('user'));
        if (!create_table($table)) {
            throw new SQLException($table . " could not be created, check log for errors.");
        }
        execute_sql('ALTER TABLE {artefact_calendar_calendar} DROP COLUMN {reminder_status}');
    }
    if ($oldversion < 2013062501) {
        execute_sql('ALTER TABLE {artefact_calendar_calendar} change {reminder_date} {reminder_date} int(4) NOT NULL;');
    }
    if ($oldversion < 2013063001) {
        $table = new XMLDBTable('artefact_calendar_event');
        $table->addFieldInfo('eventid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL);
        $table->addFieldInfo('begin', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL);
        $table->addFieldInfo('end', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL);
        $table->addFieldInfo('whole_day', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL);
        $table->addFieldInfo('repeat_type', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL);
        $table->addFieldInfo('repeats_every', XMLDB_TYPE_INTEGER, '3', null, XMLDB_NOTNULL);
        $table->addFieldInfo('end_date', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL);
        $table->addFieldInfo('ends_after', XMLDB_TYPE_INTEGER, '3', null, XMLDB_NOTNULL);
        $table->addKeyInfo('event_pk', XMLDB_KEY_PRIMARY, array('eventid'));
        if (!create_table($table)) {
            throw new SQLException($table . " could not be created, check log for errors.");
        }
    }
    return true;
}
开发者ID:vohung96,项目名称:mahara,代码行数:34,代码来源:upgrade.php


示例3: xmldb_artefact_comment_upgrade

function xmldb_artefact_comment_upgrade($oldversion = 0)
{
    $success = true;
    if ($oldversion < 2011011201) {
        $table = new XMLDBTable('artefact_comment_comment');
        $field = new XMLDBField('rating');
        $field->setAttributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED);
        $success = $success && add_field($table, $field);
    }
    if ($oldversion < 2013072400) {
        $table = new XMLDBTable('artefact_comment_comment');
        $field = new XMLDBField('lastcontentupdate');
        $field->setAttributes(XMLDB_TYPE_DATETIME);
        $success = $success && add_field($table, $field);
        $success = $success && execute_sql('update {artefact_comment_comment} acc
            set lastcontentupdate = (
                select a.mtime
                from {artefact} a
                where a.id = acc.artefact
            )');
    }
    if ($oldversion < 2015081000) {
        // Set default maxindent for threaded comments
        set_config_plugin('artefact', 'comment', 'maxindent', 5);
    }
    return $success;
}
开发者ID:rboyatt,项目名称:mahara,代码行数:27,代码来源:upgrade.php


示例4: xmldb_assignment_upgrade

function xmldb_assignment_upgrade($oldversion = 0)
{
    global $CFG, $THEME, $db;
    $result = true;
    if ($result && $oldversion < 2007091900) {
        /// MDL-11268
        /// Changing nullability of field data1 on table assignment_submissions to null
        $table = new XMLDBTable('assignment_submissions');
        $field = new XMLDBField('data1');
        $field->setAttributes(XMLDB_TYPE_TEXT, 'small', null, null, null, null, null, null, 'numfiles');
        /// Launch change of nullability for field data1
        $result = $result && change_field_notnull($table, $field);
        /// Changing nullability of field data2 on table assignment_submissions to null
        $field = new XMLDBField('data2');
        $field->setAttributes(XMLDB_TYPE_TEXT, 'small', null, null, null, null, null, null, 'data1');
        /// Launch change of nullability for field data2
        $result = $result && change_field_notnull($table, $field);
    }
    if ($result && $oldversion < 2007091902) {
        // add draft tracking default to existing upload assignments
        $sql = "UPDATE {$CFG->prefix}assignment SET var4=1 WHERE assignmenttype='upload'";
        $result = execute_sql($sql);
    }
    //===== 1.9.0 upgrade line ======//
    if ($result && $oldversion < 2007101511) {
        notify('Processing assignment grades, this may take a while if there are many assignments...', 'notifysuccess');
        // change grade typo to text if no grades MDL-13920
        require_once $CFG->dirroot . '/mod/assignment/lib.php';
        // too much debug output
        $db->debug = false;
        assignment_update_grades();
        $db->debug = true;
    }
    return $result;
}
开发者ID:edwinphillips,项目名称:moodle-485cb39,代码行数:35,代码来源:upgrade.php


示例5: xmldb_artefact_resume_upgrade

function xmldb_artefact_resume_upgrade($oldversion = 0)
{
    $status = true;
    if ($oldversion < 2009122100) {
        $table = new XMLDBTable('artefact_resume_employmenthistory');
        $field = new XMLDBField('employeraddress');
        $field->setAttributes(XMLDB_TYPE_TEXT);
        add_field($table, $field);
        $table = new XMLDBTable('artefact_resume_educationhistory');
        $field = new XMLDBField('institutionaddress');
        $field->setAttributes(XMLDB_TYPE_TEXT);
        add_field($table, $field);
    }
    if ($oldversion < 2010020300) {
        $table = new XMLDBTable('artefact_resume_educationhistory');
        $field = new XMLDBField('qualtype');
        $field->setAttributes(XMLDB_TYPE_TEXT);
        change_field_notnull($table, $field);
        $table = new XMLDBTable('artefact_resume_educationhistory');
        $field = new XMLDBField('qualname');
        $field->setAttributes(XMLDB_TYPE_TEXT);
        change_field_notnull($table, $field);
    }
    if ($oldversion < 2013071300) {
        $table = new XMLDBTable('artefact_resume_book');
        $field = new XMLDBField('url');
        $field->setAttributes(XMLDB_TYPE_TEXT);
        add_field($table, $field);
    }
    if ($oldversion < 2013072900) {
        execute_sql("UPDATE {blocktype_installed_category} SET category = 'internal' WHERE category = 'resume'");
    }
    return $status;
}
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:34,代码来源:upgrade.php


示例6: log

function log($log)
{
    //Insert new log to the database
    $date = new date(DATE_ATOM);
    $sql = "INSERT INTO  mdl_deva_log (description, date) VALUES ('" . $log . "','" . $date . "');";
    execute_sql($sql);
}
开发者ID:arshanam,项目名称:Moodle-ITScholars-LMS,代码行数:7,代码来源:log.php


示例7: backup_upgrade

function backup_upgrade($oldversion = 0)
{
    global $CFG;
    $result = true;
    if ($oldversion < 2006011600 and $result) {
        $result = execute_sql("DROP TABLE {$CFG->prefix}backup_files");
        if ($result) {
            $result = execute_sql("CREATE TABLE {$CFG->prefix}backup_files (\n                          id SERIAL PRIMARY KEY,\n                          backup_code integer NOT NULL default '0',\n                          file_type varchar(10) NOT NULL default '',\n                          path varchar(255) NOT NULL default '',\n                          old_id integer default NULL,\n                          new_id integer default NULL,\n                          CONSTRAINT {$CFG->prefix}backup_files_uk UNIQUE (backup_code, file_type, path))");
        }
        if ($result) {
            $result = execute_sql("DROP TABLE {$CFG->prefix}backup_ids");
        }
        if ($result) {
            $result = execute_sql("CREATE TABLE {$CFG->prefix}backup_ids (\n                          id SERIAL PRIMARY KEY,\n                          backup_code integer NOT NULL default '0',\n                          table_name varchar(30) NOT NULL default '',\n                          old_id integer NOT NULL default '0',\n                          new_id integer default NULL,\n                          info text,\n                          CONSTRAINT {$CFG->prefix}backup_ids_uk UNIQUE (backup_code, table_name, old_id))");
        }
    }
    if ($oldversion < 2006042801) {
        table_column('backup_log', 'time', 'time', 'integer', '', '', '0');
        table_column('backup_log', 'laststarttime', 'laststarttime', 'integer', '', '', '0');
        table_column('backup_log', 'courseid', 'courseid', 'integer', '', '', '0');
        table_column('backup_courses', 'lastendtime', 'lastendtime', 'integer', '', '', '0');
        table_column('backup_courses', 'laststarttime', 'laststarttime', 'integer', '', '', '0');
        table_column('backup_courses', 'courseid', 'courseid', 'integer', '', '', '0');
        table_column('backup_courses', 'nextstarttime', 'nextstarttime', 'integer', '', '', '0');
    }
    //////  DO NOT ADD NEW THINGS HERE!!  USE upgrade.php and the lib/ddllib.php functions.
    //Finally, return result
    return $result;
}
开发者ID:edwinphillips,项目名称:moodle-485cb39,代码行数:29,代码来源:postgres7.php


示例8: game_insert_glossaries_ids

function game_insert_glossaries_ids($course, $backup_unique_code, $instances = null)
{
    global $CFG;
    // Insert categories used by games
    $status = execute_sql("INSERT INTO {$CFG->prefix}backup_ids\n                                   (backup_code, table_name, old_id, info)\n                               SELECT DISTINCT {$backup_unique_code}, 'glossary', g.glossaryid, ''\n                               FROM {$CFG->prefix}game g\n                               WHERE g.course={$course}", false);
    return $status;
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:7,代码来源:backuplib.php


示例9: certificate_upgrade

function certificate_upgrade($oldversion)
{
    global $CFG;
    if ($oldversion < 2006081700) {
        execute_sql(" ALTER TABLE `{$CFG->prefix}certificate_issues` CHANGE `classname` `classname` VARCHAR( 254 )");
    }
    return true;
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:8,代码来源:mysql.php


示例10: log

function log($log)
{
    //Insert new log to the database
    //$date = new date(DATE_ATOM);
    $date = new date("yyyy-mm-dd HH:ii:ss");
    $sql = "INSERT INTO  mdl_shoppingcart_log (description, date) VALUES ('" . $log . "','" . $date . "');";
    execute_sql($sql);
}
开发者ID:jhena005,项目名称:vlabsdevelopment,代码行数:8,代码来源:dblog.php


示例11: email_upgrade

function email_upgrade($oldversion = 0)
{
    global $CFG;
    $result = true;
    if ($oldversion < 2005012800 && $result) {
        execute_sql(" create table " . $CFG->prefix . "block_quickmail_log\n                    ( id int(10) unsigned not null auto_increment,\n                      courseid int(10) unsigned not null,\n                      userid int(10) unsigned not null,\n                      mailto text not null,\n                      subject varchar(255) not null,\n                      message text not null,\n                      attachment varchar(255) not null,\n                      format tinyint(3) unsigned not null default 1,\n                      timesent int(10) unsigned not null,\n                      PRIMARY KEY  (`id`)\n                    )");
    }
    return $result;
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:9,代码来源:mysql.php


示例12: db_setUserTimeZone

function db_setUserTimeZone($userId, $timeZoneId)
{
    try {
        $sql = "UPDATE mdl_user_info_data SET data ='" . $timeZoneId . "' WHERE userid = " . $userId . " and fieldid = 4";
        execute_sql($sql, false);
    } catch (Exception $e) {
        echo $e->getMessage();
    }
}
开发者ID:arshanam,项目名称:Moodle-ITScholars-LMS,代码行数:9,代码来源:db.php


示例13: hotpot_upgrade

function hotpot_upgrade($oldversion)
{
    global $CFG;
    $ok = true;
    // set path to update functions
    $update_to_v2 = "{$CFG->dirroot}/mod/hotpot/db/update_to_v2.php";
    // if the version number indicates this could be an early HotPot v2.1 (Moodle 1.6),
    // check this is not actually HotPot v1 or v2.0 (Moodle 1.5) with an overly advanced version number
    if ($oldversion > 2005031400 && $oldversion <= 2006082899) {
        require_once $update_to_v2;
        if (hotpot_db_table_exists('hotpot_attempts')) {
            if (hotpot_db_field_exists('hotpot_attempts', 'details')) {
                // HotPot v2.0 (Moodle 1.5)
                $oldversion = 2005031400;
            }
        } else {
            // HotPot v1
            $oldversion = 2004122000;
        }
    }
    if ($oldversion < 2004021400) {
        execute_sql(" ALTER TABLE `{$CFG->prefix}hotpot_events` ADD `starttime` INT(10) unsigned NOT NULL DEFAULT '0' AFTER `time`");
        execute_sql(" ALTER TABLE `{$CFG->prefix}hotpot_events` ADD `endtime` INT(10) unsigned NOT NULL DEFAULT '0' AFTER `time`");
    }
    // update from HotPot v1 to HotPot v2
    if ($oldversion < 2005031400) {
        require_once $update_to_v2;
        $ok = $ok && hotpot_update_to_v2_from_v1();
    }
    if ($oldversion < 2005090700) {
        require_once $update_to_v2;
        $ok = $ok && hotpot_update_to_v2_1();
    }
    if ($oldversion > 2005031419 && $oldversion < 2005090702) {
        // update to from HotPot v2.1.0 or v2.1.1
        require_once $update_to_v2;
        $ok = $ok && hotpot_update_to_v2_1_2();
    }
    if ($oldversion < 2006042103) {
        require_once $update_to_v2;
        $ok = $ok && hotpot_update_to_v2_1_16();
    }
    if ($oldversion < 2006042601) {
        require_once $update_to_v2;
        $ok = $ok && hotpot_update_to_v2_1_17();
    }
    if ($oldversion < 2006042803) {
        require_once $update_to_v2;
        $ok = $ok && hotpot_update_to_v2_1_18();
    }
    if ($oldversion < 2006083101) {
        require_once $update_to_v2;
        $ok = $ok && hotpot_update_to_v2_2();
    }
    //////  DO NOT ADD NEW THINGS HERE!!  USE upgrade.php and the lib/ddllib.php functions.
    return $ok;
}
开发者ID:JackCanada,项目名称:moodle-hacks,代码行数:57,代码来源:mysql.php


示例14: resource_upgrade

function resource_upgrade($oldversion)
{
    // This function does anything necessary to upgrade
    // older versions to match current functionality
    global $CFG;
    if ($oldversion < 2004013101) {
        modify_database("", "INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('resource', 'update', 'resource', 'name');");
        modify_database("", "INSERT INTO prefix_log_display (module, action, mtable, field) VALUES ('resource', 'add', 'resource', 'name');");
    }
    if ($oldversion < 2004071000) {
        table_column("resource", "", "popup", "text", "", "", "", "", "alltext");
        if ($resources = get_records_select("resource", "type='3' OR type='5'", "", "id, alltext")) {
            foreach ($resources as $resource) {
                $resource->popup = addslashes($resource->alltext);
                $resource->alltext = "";
                if (!update_record("resource", $resource)) {
                    notify("Error updating popup field for resource id = {$resource->id}");
                }
            }
        }
        require_once "{$CFG->dirroot}/course/lib.php";
        rebuild_course_cache();
    }
    if ($oldversion < 2004071300) {
        table_column("resource", "", "options", "varchar", "255", "", "", "", "popup");
    }
    if ($oldversion < 2004071303) {
        table_column("resource", "type", "type", "varchar", "30", "", "", "", "");
        modify_database("", "UPDATE prefix_resource SET type='reference' WHERE type='1';");
        modify_database("", "UPDATE prefix_resource SET type='file', options='frame' WHERE type='2';");
        modify_database("", "UPDATE prefix_resource SET type='file' WHERE type='3';");
        modify_database("", "UPDATE prefix_resource SET type='text', options='0' WHERE type='4';");
        modify_database("", "UPDATE prefix_resource SET type='file' WHERE type='5';");
        modify_database("", "UPDATE prefix_resource SET type='html' WHERE type='6';");
        modify_database("", "UPDATE prefix_resource SET type='file' WHERE type='7';");
        modify_database("", "UPDATE prefix_resource SET type='text', options='3' WHERE type='8';");
        modify_database("", "UPDATE prefix_resource SET type='directory' WHERE type='9';");
    }
    if ($oldversion < 2004080801) {
        modify_database("", "UPDATE prefix_resource SET alltext=reference,type='html' WHERE type='reference';");
        rebuild_course_cache();
    }
    if ($oldversion < 2004111200) {
        //drop first to avoid conflicts when upgrading
        execute_sql("DROP INDEX {$CFG->prefix}resource_course_idx;", false);
        modify_database('', 'CREATE INDEX prefix_resource_course_idx ON prefix_resource (course);');
    }
    if ($oldversion < 2005041100) {
        // replace wiki-like with markdown
        include_once "{$CFG->dirroot}/lib/wiki_to_markdown.php";
        $wtm = new WikiToMarkdown();
        $wtm->update('resource', 'alltext', 'options');
    }
    //////  DO NOT ADD NEW THINGS HERE!!  USE upgrade.php and the lib/ddllib.php functions.
    return true;
}
开发者ID:edwinphillips,项目名称:moodle-485cb39,代码行数:56,代码来源:postgres7.php


示例15: xmldb_assignment_type_poodllonline_upgrade

function xmldb_assignment_type_poodllonline_upgrade($oldversion = 0)
{
    global $CFG, $THEME, $db;
    if ($oldversion < 2010030312) {
        // add field to store media comments (audio or video) filename to students submissions
        $sql = "ALTER TABLE {$CFG->prefix}assignment_submissions ADD poodllfeedback TEXT";
        $result = execute_sql($sql);
    }
    return $result;
}
开发者ID:laiello,项目名称:poodll,代码行数:10,代码来源:upgrade.php


示例16: questionnaire_upgrade

function questionnaire_upgrade($oldversion)
{
    /// This function does anything necessary to upgrade
    /// older versions to match current functionality
    global $CFG;
    if ($oldversion < 2004021300) {
        # Do something ...
    }
    if ($oldversion < 2004081300) {
        execute_sql('ALTER TABLE `' . $CFG->prefix . 'questionnaire` ADD `respondenttype` ENUM( \'fullname\', \'anonymous\' ) DEFAULT \'fullname\' NOT NULL AFTER `qtype`');
    }
    if ($oldversion < 2004090700) {
        execute_sql('ALTER TABLE `' . $CFG->prefix . 'questionnaire` ADD `resp_eligible` ENUM( \'all\', \'students\', \'teachers\' ) DEFAULT \'all\' NOT NULL AFTER `respondenttype`');
    }
    if ($oldversion < 2004090900) {
        execute_sql('ALTER TABLE `' . $CFG->prefix . 'questionnaire` ADD `opendate` INT( 10 ) NOT NULL AFTER `resp_eligible` , ' . 'ADD `closedate` INT( 10 ) NOT NULL AFTER `opendate`');
    }
    if ($oldversion < 2005021100) {
        execute_sql('ALTER TABLE `' . $CFG->prefix . 'questionnaire` ADD INDEX ( `sid` )');
        execute_sql('ALTER TABLE `' . $CFG->prefix . 'questionnaire_survey` ADD INDEX ( `owner` )');
        execute_sql('ALTER TABLE `' . $CFG->prefix . 'questionnaire_survey` DROP INDEX `name` , ' . 'ADD INDEX `name` ( `name` )');
        questionnaire_upgrade_2005021100();
    }
    if ($oldversion < 2005030100) {
        execute_sql('ALTER TABLE `' . $CFG->prefix . 'questionnaire_attempts` ADD `rid` INT( 10 ) UNSIGNED ' . 'DEFAULT \'0\' NOT NULL AFTER `userid`');
    }
    if ($oldversion < 2005062700) {
        modify_database('', 'ALTER TABLE `prefix_questionnaire_response_bool` DROP PRIMARY KEY ;');
        modify_database('', 'ALTER TABLE `prefix_questionnaire_response_bool` ADD `id` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST ;');
        modify_database('', 'ALTER TABLE `prefix_questionnaire_response_bool` ADD INDEX `response_question` ( `response_id` , `question_id` ) ;');
        modify_database('', 'ALTER TABLE `prefix_questionnaire_response_single` DROP PRIMARY KEY ;');
        modify_database('', 'ALTER TABLE `prefix_questionnaire_response_single` ADD `id` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST ;');
        modify_database('', 'ALTER TABLE `prefix_questionnaire_response_single` ADD INDEX `response_question` ( `response_id` , `question_id` ) ;');
        modify_database('', 'ALTER TABLE `prefix_questionnaire_response_rank` DROP PRIMARY KEY ;');
        modify_database('', 'ALTER TABLE `prefix_questionnaire_response_rank` ADD `id` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST ;');
        modify_database('', 'ALTER TABLE `prefix_questionnaire_response_rank` ADD INDEX `response_question_choice` ( `response_id` , `question_id`, `choice_id` ) ;');
        modify_database('', 'ALTER TABLE `prefix_questionnaire_response_text` DROP PRIMARY KEY ;');
        modify_database('', 'ALTER TABLE `prefix_questionnaire_response_text` ADD `id` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST ;');
        modify_database('', 'ALTER TABLE `prefix_questionnaire_response_text` ADD INDEX `response_question` ( `response_id` , `question_id` ) ;');
        modify_database('', 'ALTER TABLE `prefix_questionnaire_response_other` DROP PRIMARY KEY ;');
        modify_database('', 'ALTER TABLE `prefix_questionnaire_response_other` ADD `id` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST ;');
        modify_database('', 'ALTER TABLE `prefix_questionnaire_response_other` ADD INDEX `response_question_choice` ( `response_id` , `question_id`, `choice_id` ) ;');
        modify_database('', 'ALTER TABLE `prefix_questionnaire_response_date` DROP PRIMARY KEY ;');
        modify_database('', 'ALTER TABLE `prefix_questionnaire_response_date` ADD `id` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST ;');
        modify_database('', 'ALTER TABLE `prefix_questionnaire_response_date` ADD INDEX `response_question` ( `response_id` , `question_id` ) ;');
    }
    if ($oldversion < 2006012700) {
        questionnaire_upgrade_2006012700();
    }
    if ($oldversion < 2006031702) {
        questionnaire_upgrade_2006031700();
    }
    return true;
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:54,代码来源:mysql.php


示例17: generateProducts

function generateProducts($file, $con)
{
    global $products;
    $products = checkProductsGlobalVariable($con);
    $multiplier = 0.15;
    $n_node = retrieveNodesCount($file, $con);
    for ($i = 0; $i < ceil($n_node * $multiplier); $i++) {
        execute_sql('<create_initial_products.php>', $con, "INSERT INTO products (name, base_cost, max_cost, global_quantity) VALUES ('P" . $i . "', '" . 0 . "', '" . frand() . "', '" . 0 . "')");
    }
    $products = fetch_nodes_toArray($con);
}
开发者ID:gabriel89,项目名称:simulator,代码行数:11,代码来源:create_initial_products.php


示例18: sms_to_email_install

/**
* Function called when plugin first installed into the database
* Utility function must be prefixed with the plugin name
* followed by an underscore.
* 
* Format: pluginname_install
* 
*/
function sms_to_email_install()
{
    $CI =& get_instance();
    // check if table already exist
    if (!$CI->db->table_exists('plugin_sms_to_email')) {
        $db_driver = $CI->db->platform();
        $db_prop = get_database_property($db_driver);
        execute_sql(APPPATH . "plugins/sms_to_email/media/" . $db_prop['file'] . "_sms_to_email.sql");
    }
    return true;
}
开发者ID:nashin8or,项目名称:Kalkun,代码行数:19,代码来源:sms_to_email.php


示例19: blacklist_number_install

/**
* Function called when plugin first installed into the database
* Utility function must be prefixed with the plugin name
* followed by an underscore.
* 
* Format: pluginname_install
* 
*/
function blacklist_number_install()
{
    $CI =& get_instance();
    // check if table already exist
    if (!$CI->db->table_exists('plugin_blacklist_number')) {
        $db_driver = $CI->db->platform();
        $db_prop = get_database_property($db_driver);
        execute_sql(APPPATH . "plugins/blacklist_number/media/" . $db_prop['file'] . "_blacklist_number.sql");
    }
    return true;
}
开发者ID:nashin8or,项目名称:Kalkun,代码行数:19,代码来源:blacklist_number.php


示例20: soap_install

/**
* Function called when plugin first installed into the database
* Utility function must be prefixed with the plugin name
* followed by an underscore.
* 
* Format: pluginname_install
* 
*/
function soap_install()
{
    $CI =& get_instance();
    $CI->load->helper('kalkun');
    // check if table already exist
    if (!$CI->db->table_exists('plugin_remote_access')) {
        $db_driver = $CI->db->platform();
        $db_prop = get_database_property($db_driver);
        execute_sql(APPPATH . "plugins/soap/media/" . $db_prop['file'] . "_remote_access.sql");
    }
    return true;
}
开发者ID:sugengstiki,项目名称:Kalkun,代码行数:20,代码来源:soap.php



注:本文中的execute_sql函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP execute_sql_file函数代码示例发布时间:2022-05-15
下一篇:
PHP execute_query函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap