当前位置: 首页>>代码示例>>PHP>>正文


PHP DB_error函数代码示例

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


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

示例1: links_update_set_categories

/**
* Add "root" category and fix categories
*
*/
function links_update_set_categories()
{
    global $_TABLES, $_LI_CONF;
    if (empty($_LI_CONF['root'])) {
        $_LI_CONF['root'] = 'site';
    }
    $root = DB_escapeString($_LI_CONF['root']);
    DB_query("INSERT INTO {$_TABLES['linkcategories']} (cid, pid, category, description, tid, created, modified, group_id, owner_id, perm_owner, perm_group, perm_members, perm_anon) VALUES ('{$root}', 'root', 'Root', 'Website root', NULL, NOW(), NOW(), 5, 2, 3, 3, 2, 2)");
    // get Links admin group number
    $group_id = DB_getItem($_TABLES['groups'], 'grp_id', "grp_name = 'Links Admin'");
    // loop through adding to category table, then update links table with cids
    $result = DB_query("SELECT DISTINCT cid AS category FROM {$_TABLES['links']}");
    $nrows = DB_numRows($result);
    for ($i = 0; $i < $nrows; $i++) {
        $A = DB_fetchArray($result);
        $category = DB_escapeString($A['category']);
        $cid = $category;
        DB_query("INSERT INTO {$_TABLES['linkcategories']} (cid,pid,category,description,tid,owner_id,group_id,created,modified) VALUES ('{$cid}','{$root}','{$category}','{$category}','all',2,'{$group_id}',NOW(),NOW())", 1);
        if ($cid != $category) {
            // still experimenting ...
            DB_query("UPDATE {$_TABLES['links']} SET cid='{$cid}' WHERE cid='{$category}'", 1);
        }
        if (DB_error()) {
            echo "Error inserting categories into linkcategories table";
            return false;
        }
    }
}
开发者ID:milk54,项目名称:geeklog-japan,代码行数:32,代码来源:mysql_updates.php

示例2: EXP_upgrade_sql

/**
*   Execute the SQL statement to perform a version upgrade.
*   An empty SQL parameter will return success.
*
*   @param string   $version  Version being upgraded to
*   @param array    $sql      SQL statement to execute
*   @return integer Zero on success, One on failure.
*/
function EXP_upgrade_sql($version = 'Undefined', $sql = '')
{
    global $_TABLES, $_CONF_EXP;
    // We control this, so it shouldn't happen, but just to be safe...
    if ($version == 'Undefined') {
        COM_errorLog("Error updating {$_CONF_EXP['pi_name']} - Undefined Version");
        return 1;
    }
    // If no sql statements passed in, return success
    if (!is_array($sql)) {
        return 0;
    }
    // Execute SQL now to perform the upgrade
    COM_errorLOG("--Updating External Pages to version {$version}");
    for ($i = 1; $i <= count($sql); $i++) {
        COM_errorLOG("External Pages Plugin {$version} update: Executing SQL => " . current($sql));
        DB_query(current($sql), '1');
        if (DB_error()) {
            COM_errorLog("SQL Error during External Pages plugin update", 1);
            return 1;
            break;
        }
        next($sql);
    }
    return 0;
}
开发者ID:JohnToro,项目名称:external,代码行数:34,代码来源:upgrade.inc.php

示例3: update_150_to_151

function update_150_to_151()
{
    global $_TABLES, $_CONF, $_SP_CONF;
    $P_SQL = array();
    $P_SQL[] = "ALTER TABLE {$_TABLES['staticpage']} ADD sp_search tinyint(4) NOT NULL default '1' AFTER postmode";
    // allow searching on all existing static pages
    $P_SQL[] = "UPDATE {$_TABLES['staticpage']} SET sp_search = 1";
    $P_SQL[] = "UPDATE {$_TABLES['plugins']} SET pi_version = '1.5.1', pi_gl_version = '1.1.0', pi_homepage='http://www.glfusion.org' WHERE pi_name = 'staticpages'";
    foreach ($P_SQL as $sql) {
        $rst = DB_query($sql, 1);
        if (DB_error()) {
            COM_errorLog("StaticPage Update Error: Could not execute the following SQL: " . $sql);
            return false;
        }
    }
    $res = DB_query("SELECT * FROM {$_TABLES['vars']} WHERE name='sp_fix_01'");
    if (DB_numRows($res) < 1) {
        $sql = "SELECT * FROM {$_TABLES['staticpage']}";
        $result = DB_query($sql);
        while ($A = DB_fetchArray($result)) {
            $newcontent = stripslashes($A['sp_content']);
            $newcontent = mysql_real_escape_string($newcontent);
            DB_query("UPDATE {$_TABLES['staticpage']} SET sp_content='" . $newcontent . "' WHERE sp_id='" . $A['sp_id'] . "'");
        }
        DB_query("INSERT INTO {$_TABLES['vars']} VALUES ('sp_fix_01', 1)", 1);
    }
    return true;
}
开发者ID:NewRoute,项目名称:glfusion,代码行数:28,代码来源:upgrade.php

示例4: GEEKLOGJP_disablePlugins

/**
* Disable incompatible plugins to prevent an error which will occur during
* the upgrade process.
*
* @link  http://code.google.com/p/geeklog-jp/wiki/manage151
*/
function GEEKLOGJP_disablePlugins()
{
    global $_TABLES;
    /**
     * Geeklog-1.5.xで動作確認の取れているプラグインのリスト。
     * $allowed_plugins['プラグイン英語名'] = '動作する最低バージョン' のフォー
     * マット。Geeklogに同梱されているプラグインはチェック不要なので、バージョン
     * は '*' とする。
     */
    $allowed_plugins = array('staticpages' => '*', 'links' => '*', 'polls' => '*', 'calendar' => '*', 'autotags' => '1.01', 'calendarjp' => '1.1.6', 'captcha' => '3.5.5', 'custommenu' => '0.2.2', 'dataproxy' => '2.0.0', 'dbman' => '0.7.1', 'filemgmt' => '1.6.0.jp3', 'forum' => '2.9.0hg', 'japanize' => '2.1.0', 'mycaljp' => '2.0.5', 'nmoxtopicown' => '1.0.12', 'sitemap' => '1.1.2', 'themedit' => '1.2.1');
    $sqls = array();
    $sql = "SELECT pi_name, pi_version " . "FROM {$_TABLES['plugins']} " . "WHERE (pi_enabled = '1') ";
    $result = DB_query($sql);
    if (!DB_error()) {
        while (($A = DB_fetchArray($result)) !== false) {
            $pi_name = $A['pi_name'];
            $pi_version = $A['pi_version'];
            if (array_key_exists($pi_name, $allowed_plugins)) {
                if ($allowed_plugins[$pi_name] == '*' or version_compare($pi_version, $allowed_plugins[$pi_name]) >= 0) {
                    continue;
                }
            }
            $sqls[] = "UPDATE {$_TABLES['plugins']} " . "SET pi_enabled = '0' " . "WHERE (pi_name = '" . addslashes($pi_name) . "') ";
        }
        if (count($sqls) > 0) {
            foreach ($sqls as $sql) {
                DB_query($sql);
            }
        }
    }
}
开发者ID:Geeklog-Japan,项目名称:geeklog-japan,代码行数:37,代码来源:disable-plugins.php

示例5: update_tables

function update_tables()
{
    global $_TABLES;
    global $_CONF;
    //マスタのデータ
    $_SQL = array();
    //=====SQL 定義 ココから
    //  更新が必要なところの条件を変更して使用してください
    if (1 === 0) {
        //カテゴリ定義に親カテゴリIDとグループID追加
        $_SQL[] = "\n\t\tCREATE TABLE {$_TABLES['DATABOX_def_fieldset']} (\n\t\t`fieldset_id` int(11) NOT NULL,\n\t\t`name` varchar(64) NOT NULL,\n\t\t`description` mediumtext,\n\t\t`udatetime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n\t\t`uuid` mediumint(8) NOT NULL,\n\t\tPRIMARY KEY (`fieldset_id`)\n\t\t) ENGINE=MyISAM\n\t\t";
        //属性セット関連
        $_SQL[] = "\n\t\tCREATE TABLE {$_TABLES['DATABOX_def_fieldset_assignments']} (\n\t\t`seq` int(11) NOT NULL AUTO_INCREMENT,\n\t\t`fieldset_id` int(11) NOT NULL,\n\t\t`field_id` int(11) NOT NULL,\n\t\tPRIMARY KEY (`seq`),\n\t\tKEY `fieldset_id` (`fieldset_id`)\n\t\t) ENGINE=MyISAM\n\t\t";
        $_SQL[] = "\n        ALTER TABLE {$_TABLES['DATABOX_base']}\n\t\tADD `fieldset_id` int(11) NOT NULL default 0 AFTER `orderno`,\n       ";
    }
    //=====SQL 定義 ココまで
    //------------------------------------------------------------------
    for ($i = 1; $i <= count($_SQL); $i++) {
        $w = current($_SQL);
        DB_query(current($_SQL));
        next($_SQL);
    }
    if (DB_error()) {
        COM_errorLog("error DataBox table update ", 1);
        return false;
    }
    COM_errorLog("Success - DataBox table update", 1);
    return "end";
}
开发者ID:mistgrass,项目名称:geeklog-ivywe,代码行数:29,代码来源:updatetable0509.php

示例6: show

 function show($e_code, $pages = 1)
 {
     global $_CONF;
     $errmsg = array("0001" => "Could not connect to the forums database.", "0002" => "The forum you selected does not exist. Please go back and try again.", "0003" => "Password Incorrect.", "0004" => "Could not query the topics database.", "0005" => "Error getting messages from the database.", "0006" => "Please enter the Nickname and the Password.", "0007" => "You are not the Moderator of this forum therefore you can't perform this function.", "0008" => "You did not enter the correct password, please go back and try again.", "0009" => "Could not remove posts from the database.", "0010" => "Could not move selected topic to selected forum. Please go back and try again.", "0011" => "Could not lock the selected topic. Please go back and try again.", "0012" => "Could not unlock the selected topic. Please go back and try again.", "0013" => "Could not query the database. <BR>Error: " . DB_error() . "", "0014" => "No such user or post in the database.", "0015" => "Search Engine was unable to query the forums database.", "0016" => "That user does not exist. Please go back and search again.", "0017" => "You must type a subject to post. You can't post an empty subject. Go back and enter the subject", "0018" => "You must choose message icon to post. Go back and choose message icon.", "0019" => "You must type a message to post. You can't post an empty message. Go back and enter a message.", "0020" => "Could not enter data into the database. Please go back and try again.", "0021" => "Can't delete the selected message.", "0022" => "An error ocurred while querying the database.", "0023" => "Selected message was not found in the forum database.", "0024" => "You can't reply to that message. It wasn't sent to you.", "0025" => "You can't post a reply to this topic, it has been locked. Contact the administrator if you have any question.", "0026" => "The forum or topic you are attempting to post to does not exist. Please try again.", "0027" => "You must enter your username and password. Go back and do so.", "0028" => "You have entered an incorrect password. Go back and try again.", "0029" => "Couldn't update post count.", "0030" => "The forum you are attempting to post to does not exist. Please try again.", "0031" => "Unknown Error", "0035" => "You can't edit a post that's not yours.", "0036" => "You do not have permission to edit this post.", "0037" => "You did not supply the correct password or do not have permission to edit this post. Please go back and try again.", "1001" => "Please enter value for Title.", "1002" => "Please enter value for Phone.", "1003" => "Please enter value for Summary.", "1004" => "Please enter value for Address.", "1005" => "Please enter value for City.", "1006" => "Please enter value for State/Province.", "1007" => "Please enter value for Zipcode.", "1008" => "Please enter value for Description.", "1009" => "Vote for the selected resource only once.<br>All votes are logged and reviewed.", "1010" => "You cannot vote on the resource you submitted.<br>All votes are logged and reviewed.", "1011" => "No rating selected - no vote tallied.", "1013" => "Please enter a search query.", "1016" => "Please enter value for Filename.", "1017" => "The file was not uploaded - reported filesize of 0 bytes.", "1101" => "Upload approval Error: The temporary file was not found. Check error.log", "1102" => "Upload submit Error: The temporary filestore file was not created. Check error.log", "1103" => "The download info you provided is already in the database!", "1104" => "The download info was not complete - Need to enter a title for the new file", "1105" => "The download info was not complete - Need to enter a description for the new file", "1106" => "Upload Add Error: The new file was not created. Check error.log", "1107" => "Upload Add Error: The temporary file was not found. Check error.log", "1108" => "Duplicate file - already existing in filestore", "1109" => "File type not allowed", "1110" => "You must define and select a category for the uploaded file", "9999" => "Unknown Error");
     // determine the destination of this request
     $destination = COM_getCurrentURL();
     // validate the destination is not blank and is part of our site...
     if ($destination == '') {
         $destination = $_CONF['site_url'] . '/filemgmt/index.php';
     }
     if (substr($destination, 0, strlen($_CONF['site_url'])) != $_CONF['site_url']) {
         $destination = $_CONF['site_url'] . '/filemgmt/index.php';
     }
     $errorno = array_keys($errmsg);
     if (!in_array($e_code, $errorno)) {
         $e_code = '9999';
     }
     include_once $_CONF['path'] . 'plugins/filemgmt/include/header.php';
     $display = COM_siteHeader('menu');
     $display .= '<table width="100%" class="plugin" border="0" cellspacing="0" cellpadding="1">';
     $display .= '<tr><td class="pluginAlert" style="text-align:right;padding:5px;">File Management Plugin</td>';
     $display .= "<td class=\"pluginAlert\" width=\"50%\" style=\"padding:5px 0px 5px 10px;\">Error Code: {$e_code}</td></tr>";
     $display .= "<tr><td colspan=\"2\" class=\"pluginInfo\"><b>ERROR:</b> {$errmsg[$e_code]}</td></tr>";
     $display .= '<tr><td colspan="2" class="pluginInfo" style="text-align:center;padding:10px;">';
     $display .= '[ <a href="' . $destination . '">Go Back</a> ]</td></tr></table>';
     $display .= COM_siteFooter();
     echo $display;
     die("");
 }
开发者ID:spacequad,项目名称:glfusion,代码行数:29,代码来源:errorhandler.php

示例7: plugin_install_captcha

function plugin_install_captcha()
{
    global $pi_name, $pi_version, $gl_version, $pi_url, $NEWTABLE, $DEFVALUES, $NEWFEATURE;
    global $_TABLES, $_CONF, $LANG_CP00, $_DB_dbms;
    COM_errorLog("Attempting to install the {$pi_name} Plugin", 1);
    $_SQL['cp_config'] = "CREATE TABLE {$_TABLES['cp_config']} ( " . "  `config_name` varchar(255) NOT NULL default '', " . "  `config_value` varchar(255) NOT NULL default '', " . "   PRIMARY KEY  (`config_name`) " . " );";
    $_SQL['cp_sessions'] = "CREATE TABLE {$_TABLES['cp_sessions']} ( " . "  `session_id` varchar(40) NOT NULL default '', " . "  `cptime`  INT(11) NOT NULL default 0, " . "  `validation` varchar(40) NOT NULL default '', " . "  `counter`    TINYINT(4) NOT NULL default 0, " . "  PRIMARY KEY (`session_id`) " . " );";
    foreach ($_SQL as $table => $sql) {
        COM_errorLog("Creating {$table} table", 1);
        DB_query($sql, 1);
        if (DB_error()) {
            COM_errorLog("Error Creating {$table} table", 1);
            plugin_uninstall_captcha();
            return false;
            exit;
        }
        COM_errorLog("Success - Created {$table} table", 1);
    }
    $SQL_DEFAULTS = "INSERT INTO `{$_TABLES['cp_config']}` (`config_name`, `config_value`) VALUES " . " ('anonymous_only', '1'), " . " ('remoteusers','0'), " . " ('debug', '0'), " . " ('enable_comment', '0'), " . " ('enable_contact', '0'), " . " ('enable_emailstory', '0'), " . " ('enable_forum', '0'), " . " ('enable_registration', '0'), " . " ('enable_story', '0'), " . " ('gfxDriver', '2'), " . " ('gfxFormat', 'jpg'), " . " ('gfxPath', '');";
    DB_query($SQL_DEFAULTS, 1);
    // Register the plugin with Geeklog
    COM_errorLog("Registering {$pi_name} plugin with Geeklog", 1);
    DB_delete($_TABLES['plugins'], 'pi_name', 'captcha');
    DB_query("INSERT INTO {$_TABLES['plugins']} (pi_name, pi_version, pi_gl_version, pi_homepage, pi_enabled) " . "VALUES ('{$pi_name}', '{$pi_version}', '{$gl_version}', '{$pi_url}', 1)");
    if (DB_error()) {
        COM_errorLog("Failure registering plugin with Geeklog");
        plugin_uninstall_captcha();
        return false;
        exit;
    }
    // Create initial log entry
    CAPTCHA_errorLog("CAPTCHA Plugin Successfully Installed");
    COM_errorLog("Successfully installed the {$pi_name} Plugin!", 1);
    return true;
}
开发者ID:hostellerie,项目名称:nexpro,代码行数:35,代码来源:install.php

示例8: nexform_importForm

function nexform_importForm($_SQL, $cntr)
{
    global $CONF_FE, $_TABLES;
    DB_query($_SQL[0], '1');
    if (DB_error()) {
        COM_errorLog("nexform SQL error importing form: {$_SQL[0]}");
    }
    $newformid = DB_insertID();
    /* Delete any previous imported form field definition records
          New field definition records will have a formid of '99999' assigned
          Insert the new records and then update to match the new form definition
       */
    DB_query("DELETE FROM {$_TABLES['nxform_fields']} WHERE formid='{$cntr}'");
    next($_SQL);
    // Increment to the field definition records
    for ($i = 1; $i < count($_SQL); $i++) {
        DB_query(current($_SQL), '1');
        if (DB_error()) {
            COM_errorLog("executing " . current($_SQL));
            COM_errorLog("Error executing SQL", 1);
            exit;
        }
        next($_SQL);
    }
    DB_query("UPDATE {$_TABLES['nxform_fields']} set formid='{$newformid}' WHERE formid='{$cntr}'");
    // Need to cycle thru the fields now and update any fieldnames if auto fieldname used
    $query = DB_query("SELECT id,type FROM {$_TABLES['nxform_fields']} WHERE formid='{$newformid}' AND field_name LIKE '%_frm%'");
    while (list($fieldid, $fieldtype) = DB_fetchArray($query)) {
        $fieldname = "{$CONF_FE['fieldtypes'][$fieldtype][0]}{$newformid}_{$fieldid}";
        DB_query("UPDATE {$_TABLES['nxform_fields']} set field_name='{$fieldname}' WHERE id='{$fieldid}'");
    }
}
开发者ID:hostellerie,项目名称:nexpro,代码行数:32,代码来源:import.php

示例9: doValidLogin

 function doValidLogin($login)
 {
     global $_CONF, $_TABLES, $status, $uid;
     // Remote auth precludes usersubmission,
     // and integrates user activation, see?;
     $status = USER_ACCOUNT_ACTIVE;
     // PHP replaces "." with "_"
     $openid_identity = DB_escapeString($this->query['openid_identity']);
     $openid_nickname = '';
     if (isset($this->query['openid_sreg_nickname'])) {
         $openid_nickname = $this->query['openid_sreg_nickname'];
     }
     // Check if that account is already registered.
     $result = DB_query("SELECT uid FROM {$_TABLES['users']} WHERE remoteusername = '{$openid_identity}' AND remoteservice = 'openid'");
     $tmp = DB_error();
     $nrows = DB_numRows($result);
     if (!($tmp == 0) || !($nrows == 1)) {
         // First time login with this OpenID, creating account...
         if ($_CONF['disable_new_user_registration']) {
             // not strictly correct - just to signal a failed login attempt
             $status = USER_ACCOUNT_DISABLED;
             $uid = 0;
             return;
         }
         if (empty($openid_nickname)) {
             $openid_nickname = $this->makeUsername($this->query['openid_identity']);
         }
         // we simply can't accept empty usernames ...
         if (empty($openid_nickname)) {
             COM_errorLog('Got an empty username for ' . $openid_identity);
             // not strictly correct - just to signal a failed login attempt
             $status = USER_ACCOUNT_DISABLED;
             $uid = 0;
             return;
         }
         // Ensure that remoteusername is unique locally.
         $openid_nickname = USER_uniqueUsername($openid_nickname);
         $openid_sreg_email = '';
         if (isset($this->query['openid_sreg_email'])) {
             $openid_sreg_email = $this->query['openid_sreg_email'];
         }
         $openid_sreg_fullname = '';
         if (isset($this->query['openid_sreg_fullname'])) {
             $openid_sreg_fullname = $this->query['openid_sreg_fullname'];
         }
         USER_createAccount($openid_nickname, $openid_sreg_email, '', $openid_sreg_fullname, '', $this->query['openid_identity'], 'openid');
         $uid = DB_getItem($_TABLES['users'], 'uid', "remoteusername = '{$openid_identity}' AND remoteservice = 'openid'");
         // Store full remote account name:
         DB_query("UPDATE {$_TABLES['users']} SET remoteusername = '{$openid_identity}', remoteservice = 'openid', status = 3 WHERE uid = {$uid}");
         // Add to remote users:
         $remote_grp = DB_getItem($_TABLES['groups'], 'grp_id', "grp_name = 'Remote Users'");
         DB_query("INSERT INTO {$_TABLES['group_assignments']} (ug_main_grp_id, ug_uid) VALUES ({$remote_grp}, {$uid})");
     } else {
         $result = DB_query("SELECT uid,status FROM {$_TABLES['users']} WHERE remoteusername = '{$openid_identity}' AND remoteservice = 'openid'");
         list($uid, $status) = DB_fetchArray($result);
     }
 }
开发者ID:NewRoute,项目名称:glfusion,代码行数:57,代码来源:openidhelper.class.php

示例10: dbman_getDBVersion

/**
* Returns DB server version
*/
function dbman_getDBVersion()
{
    $rst = DB_query("SHOW VARIABLES");
    if (!DB_error()) {
        while (($r = DB_fetchArray($rst)) !== FALSE) {
            if ($r['Variable_name'] === 'version') {
                return $r['Value'];
            }
        }
    }
    return 'unavailable';
}
开发者ID:milk54,项目名称:geeklog-japan,代码行数:15,代码来源:dbman-mysql.inc.php

示例11: update_tables

function update_tables()
{
    global $_TABLES;
    global $_CONF;
    //マスタのデータ
    $_SQL = array();
    //  更新が必要なところの条件を変更して使用してください
    //20110208
    if (1 === 0) {
        $_SQL[] = "\n        ALTER TABLE {$_TABLES['USERBOX_base']}\n        CHANGE `orderno` `orderno` INT( 2 ) NOT NULL DEFAULT '0'\n        ";
        $_SQL[] = "\n        ALTER TABLE {$_TABLES['USERBOX_base']}\n        CHANGE `expired` `expired` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00'\n        ";
    }
    //20110622
    // userbox.edit (gl_feature) add
    if (1 === 0) {
        $_SQL[] = "\n        INSERT INTO {$_TABLES['features']} (\n        `ft_name` ,\n        `ft_descr` ,\n        `ft_gl_core`\n        )\n        VALUES (\n\t\t'userbox.edit', 'can edit profile to userbox plugin', '0'\n        )\n\t\t";
        $_SQL[] = "\n        INSERT INTO {$_TABLES['features']} (\n        `ft_name` ,\n        `ft_descr` ,\n        `ft_gl_core`\n        )\n        VALUES (\n\t\t'userbox.joingroup', 'can edit join group to userbox plugin', '0'\n        )\n\t\t";
    }
    //20110803
    // group_id=0 add
    if (1 === 0) {
        $_SQL[] = "\n\t\tINSERT INTO {$_TABLES['USERBOX_def_group']} (\n\t\t`group_id` \n\t\t)\n\t\tVALUES (\n\t\t'0'\n\t\t);\n\t\t";
    }
    //20110826
    // group_id=0 add
    if (1 === 0) {
        $_SQL[] = "\n\t\tALTER TABLE {$_TABLES['USERBOX_base']}\n\t\tADD `eyechatchingimage` MEDIUMTEXT NULL AFTER `defaulttemplatesdirectory` \n\t\t";
    }
    //20110915
    // group_id=0 add
    if (1 === 1) {
        $_SQL[] = "\n        INSERT INTO {$_TABLES['features']} (\n        `ft_name` ,\n        `ft_descr` ,\n        `ft_gl_core`\n        )\n        VALUES (\n\t\t'userbox.user', 'Can register to UserBox', '0'\n        )\n\t\t";
    }
    //------------------------------------------------------------------
    for ($i = 1; $i <= count($_SQL); $i++) {
        $w = current($_SQL);
        DB_query(current($_SQL));
        next($_SQL);
    }
    if (DB_error()) {
        COM_errorLog("error UserBox table update ", 1);
        return false;
    }
    COM_errorLog("Success - UserBox table update", 1);
    return "end";
}
开发者ID:mistgrass,项目名称:geeklog-ivywe,代码行数:46,代码来源:updatetable.php

示例12: adDelete

/**
*  Delete an ad and associated photos
*
*  @param integer $ad_id    Ad ID number
*  @param boolean $admin    True if this is an administrator
*/
function adDelete($ad_id = '', $admin = false, $table = 'ad_ads')
{
    global $_USER, $_TABLES, $_CONF_ADVT;
    $ad_id = COM_sanitizeID($ad_id);
    if ($ad_id == '') {
        return 1;
    }
    if ($table != 'ad_ads' && $table != 'ad_submission') {
        return 2;
    }
    // Check the user's access level.  If this is an admin call,
    // force access to read-write.
    $myaccess = $admin ? 3 : CLASSIFIEDS_checkAccess($ad_id);
    if ($myaccess < 3) {
        return 3;
    }
    /*    $selection = "ad_id = '$ad_id'";
        if (!$admin) {
            $selection.= " AND uid={$_USER['uid']}";
        }
        $ad = DB_getItem($_TABLES[$table], 'ad_id', $selection);
        if ($ad == '')
            return 5;*/
    // If we've gotten this far, then the current user has access
    // to delete this ad.
    if ($table == 'ad_submission') {
        // Do the normal plugin rejection stuff
        plugin_moderationdelete_classifieds($ad_id);
    } else {
        // Do the extra cleanup manually
        if (deletePhotos($ad_id) != 0) {
            return 5;
        }
    }
    // After the cleanup stuff, delete the ad record itself.
    DB_delete($_TABLES[$table], 'ad_id', $ad_id);
    CLASSIFIEDS_auditLog("Ad {$ad_id} deleted.");
    if (DB_error()) {
        COM_errorLog(DB_error());
        return 4;
    } else {
        return 0;
    }
}
开发者ID:NewRoute,项目名称:classifieds,代码行数:50,代码来源:advt_functions.inc.php

示例13: MG_batchDeleteSession

function MG_batchDeleteSession()
{
    global $_MG_CONF, $_CONF, $_TABLES;
    if (!empty($_POST['sel'])) {
        $numItems = count($_POST['sel']);
        for ($i = 0; $i < $numItems; $i++) {
            DB_delete($_TABLES['mg_session_items'], 'session_id', $_POST['sel'][$i]);
            if (DB_error()) {
                COM_errorLog("Media Gallery Error: Error removing session items");
            }
            DB_delete($_TABLES['mg_sessions'], 'session_id', $_POST['sel'][$i]);
            if (DB_error()) {
                COM_errorLog("Media Gallery Error: Error removing session");
            }
        }
    }
    echo COM_refresh($_MG_CONF['admin_url'] . 'sessions.php');
    exit;
}
开发者ID:mistgrass,项目名称:geeklog-ivywe,代码行数:19,代码来源:sessions.php

示例14: polls_update_polltopics

/**
* Hook up pollquestions with polltopics
*
*/
function polls_update_polltopics()
{
    global $_TABLES;
    $move_sql = "SELECT pid, topic FROM {$_TABLES['polltopics']}";
    $move_rst = DB_query($move_sql);
    $count_move = DB_numRows($move_rst);
    for ($i = 0; $i < $count_move; $i++) {
        $A = DB_fetchArray($move_rst);
        $A[1] = mysql_real_escape_string($A[1]);
        $P_SQL[] = "INSERT INTO {$_TABLES['pollquestions']} (pid, question) VALUES ('{$A[0]}','{$A[1]}');";
    }
    foreach ($P_SQL as $sql) {
        $rst = DB_query($sql);
        if (DB_error()) {
            echo "There was an error upgrading the polls, SQL: {$sql}<br>";
            return false;
        }
    }
}
开发者ID:alxstuart,项目名称:ajfs.me,代码行数:23,代码来源:mysql_updates.php

示例15: MG_batchDeleteSession

function MG_batchDeleteSession()
{
    global $_MG_CONF, $_CONF, $_TABLES, $_POST;
    $numItems = count($_POST['sel']);
    for ($i = 0; $i < $numItems; $i++) {
        $sql = "DELETE FROM {$_TABLES['mg_session_items']} WHERE session_id='" . $_POST['sel'][$i] . "'";
        $result = DB_query($sql);
        if (DB_error()) {
            COM_errorLog("Media Gallery Error: Error removing session items");
        }
        $sql = "DELETE FROM {$_TABLES['mg_sessions']} WHERE session_id='" . $_POST['sel'][$i] . "'";
        $result = DB_query($sql);
        if (DB_error()) {
            COM_errorLog("Media Gallery Error: Error removing session");
        }
    }
    echo COM_refresh($_MG_CONF['admin_url'] . 'sessions.php');
    exit;
}
开发者ID:spacequad,项目名称:glfusion,代码行数:19,代码来源:sessions.php


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