⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tbl_change.php

📁 phpMyAdmin图形界面化操作,我已经配置好了,只要把解要压缩后的文件放到站点下就可以用了
💻 PHP
📖 第 1 页 / 共 4 页
字号:
            array('ShowFunctionFields' => 0));        echo '          <th><a href="tbl_change.php' . PMA_generate_common_url($this_url_params) . '" title="' . $strHide . '">' . $strFunction . '</a></th>' . "\n";    }?>            <th><?php echo $strNull; ?></th>            <th><?php echo $strValue; ?></th>        </tr>    </thead>    <tfoot>        <tr>            <th colspan="5" align="right" class="tblFooters">                <input type="submit" value="<?php echo $strGo; ?>" />            </th>        </tr>    </tfoot>    <tbody><?php    // Sets a multiplier used for input-field counts (as zero cannot be used, advance the counter plus one)    $m_rows = $o_rows + 1;    $odd_row = true;    for ($i = 0; $i < $fields_cnt; $i++) {        if (! isset($table_fields[$i]['processed'])) {            $table_fields[$i]['Field_html'] = htmlspecialchars($table_fields[$i]['Field']);            $table_fields[$i]['Field_md5']  = md5($table_fields[$i]['Field']);            // True_Type contains only the type (stops at first bracket)            $table_fields[$i]['True_Type']  = preg_replace('@\(.*@s', '', $table_fields[$i]['Type']);            // d a t e t i m e            //            // loic1: current date should not be set as default if the field is NULL            //        for the current row            // lem9:  but do not put here the current datetime if there is a default            //        value (the real default value will be set in the            //        Default value logic below)            // Note: (tested in MySQL 4.0.16): when lang is some UTF-8,            // $field['Default'] is not set if it contains NULL:            // Array ([Field] => d [Type] => datetime [Null] => YES [Key] => [Extra] => [True_Type] => datetime)            // but, look what we get if we switch to iso: (Default is NULL)            // Array ([Field] => d [Type] => datetime [Null] => YES [Key] => [Default] => [Extra] => [True_Type] => datetime)            // so I force a NULL into it (I don't think it's possible            // to have an empty default value for DATETIME)            // then, the "if" after this one will work            if ($table_fields[$i]['Type'] == 'datetime'             && ! isset($table_fields[$i]['Default'])             && isset($table_fields[$i]['Null'])             && $table_fields[$i]['Null'] == 'YES') {                $table_fields[$i]['Default'] = null;            }            $table_fields[$i]['len'] =                preg_match('@float|double@', $table_fields[$i]['Type']) ? 100 : -1;            if (isset($comments_map[$table_fields[$i]['Field']])) {                $table_fields[$i]['Field_title'] = '<span style="border-bottom: 1px dashed black;" title="'                    . htmlspecialchars($comments_map[$table_fields[$i]['Field']]) . '">'                    . $table_fields[$i]['Field_html'] . '</span>';            } else {                $table_fields[$i]['Field_title'] = $table_fields[$i]['Field_html'];            }            // The type column            $table_fields[$i]['is_binary'] = stristr($table_fields[$i]['Type'], 'binary');            $table_fields[$i]['is_blob']   = stristr($table_fields[$i]['Type'], 'blob');            $table_fields[$i]['is_char']   = stristr($table_fields[$i]['Type'], 'char');            $table_fields[$i]['first_timestamp'] = false;            switch ($table_fields[$i]['True_Type']) {                case 'set':                    $table_fields[$i]['pma_type'] = 'set';                    $table_fields[$i]['wrap']  = '';                    break;                case 'enum':                    $table_fields[$i]['pma_type'] = 'enum';                    $table_fields[$i]['wrap']  = '';                    break;                case 'timestamp':                    if (!$timestamp_seen) {   // can only occur once per table                        $timestamp_seen  = 1;                        $table_fields[$i]['first_timestamp'] = true;                    }                    $table_fields[$i]['pma_type'] = $table_fields[$i]['Type'];                    $table_fields[$i]['wrap']  = ' nowrap="nowrap"';                    break;                default:                    $table_fields[$i]['pma_type'] = $table_fields[$i]['Type'];                    $table_fields[$i]['wrap']  = ' nowrap="nowrap"';                    break;            }        }        $field = $table_fields[$i];        $extracted_fieldspec = PMA_extractFieldSpec($field['Type']);        if (-1 === $field['len']) {            $field['len'] = PMA_DBI_field_len($vresult, $i);        }        $unnullify_trigger = $chg_evt_handler . "=\"return unNullify('"            . PMA_escapeJsString($field['Field_html']) . "', '"            . PMA_escapeJsString($jsvkey) . "')\"";        $field_name_appendix =  $vkey . '[' . $field['Field_html'] . ']';        $field_name_appendix_md5 = $field['Field_md5'] . $vkey . '[]';        if ($field['Type'] == 'datetime'         && ! isset($field['Default'])         && ! is_null($field['Default'])         && ($insert_mode || ! isset($vrow[$field['Field']]))) {            // INSERT case or            // UPDATE case with an NULL value            $vrow[$field['Field']] = date('Y-m-d H:i:s', time());        }        ?>        <tr class="<?php echo $odd_row ? 'odd' : 'even'; ?>">            <td <?php echo ($cfg['LongtextDoubleTextarea'] && strstr($field['True_Type'], 'longtext') ? 'rowspan="2"' : ''); ?> align="center"><?php echo $field['Field_title']; ?></td>            <td align="center"<?php echo $field['wrap']; ?>>                <?php echo $field['pma_type']; ?>            </td>        <?php        // Prepares the field value        $real_null_value = FALSE;        $special_chars_encoded = '';        if (isset($vrow)) {            // On a BLOB that can have a NULL value, the is_null() returns            // true if it has no content but for me this is different than            // having been set explicitely to NULL so I put an exception here            if (! $field['is_blob'] && is_null($vrow[$field['Field']])) {                $real_null_value = TRUE;                $vrow[$field['Field']]    = '';                $special_chars   = '';                $data            = $vrow[$field['Field']];            } elseif ($field['True_Type'] == 'bit') {                $special_chars = PMA_printable_bit_value($vrow[$field['Field']], $extracted_fieldspec['spec_in_brackets']);            } else {                // loic1: special binary "characters"                if ($field['is_binary'] || $field['is_blob']) {                    $vrow[$field['Field']] = PMA_replace_binary_contents($vrow[$field['Field']]);                 } // end if                $special_chars   = htmlspecialchars($vrow[$field['Field']]);				//We need to duplicate the first \n or otherwise we will lose the first newline entered in a VARCHAR or TEXT column	        $special_chars_encoded = PMA_duplicateFirstNewline($special_chars);                $data            = $vrow[$field['Field']];            } // end if... else...            // loic1: if a timestamp field value is not included in an update            //        statement MySQL auto-update it to the current timestamp            // lem9:  however, things have changed since MySQL 4.1, so            //        it's better to set a fields_prev in this situation            $backup_field  = '<input type="hidden" name="fields_prev'                . $field_name_appendix . '" value="'                . htmlspecialchars($vrow[$field['Field']]) . '" />';        } else {            // loic1: display default values            if (!isset($field['Default'])) {                $field['Default'] = '';                $real_null_value          = TRUE;                $data                     = '';            } else {                $data                     = $field['Default'];            }            if ($field['True_Type'] == 'bit') {                $special_chars = PMA_printable_bit_value($field['Default'], $extracted_fieldspec['spec_in_brackets']);             } else {                $special_chars = htmlspecialchars($field['Default']);            }            $backup_field  = '';        }        $idindex  = ($o_rows * $fields_cnt) + $i + 1;        $tabindex = (($idindex - 1) * 3) + 1;        // The function column        // -------------------        // Change by Bernard M. Piller <bernard@bmpsystems.com>        // We don't want binary data to be destroyed        // Note: from the MySQL manual: "BINARY doesn't affect how the column is        //       stored or retrieved" so it does not mean that the contents is        //       binary        if ($cfg['ShowFunctionFields']) {            if (($cfg['ProtectBinary'] && $field['is_blob'] && !$is_upload)             || ($cfg['ProtectBinary'] == 'all' && $field['is_binary'])) {                echo '        <td align="center">' . $strBinary . '</td>' . "\n";            } elseif (strstr($field['True_Type'], 'enum') || strstr($field['True_Type'], 'set')) {                echo '        <td align="center">--</td>' . "\n";            } else {                ?>            <td>                <select name="funcs<?php echo $field_name_appendix; ?>" <?php echo $unnullify_trigger; ?> tabindex="<?php echo ($tabindex + $tabindex_for_function); ?>" id="field_<?php echo $idindex; ?>_1">                    <option></option>                <?php                $selected     = '';                // garvin: Find the current type in the RestrictColumnTypes. Will result in 'FUNC_CHAR'                // or something similar. Then directly look up the entry in the RestrictFunctions array,                // which will then reveal the available dropdown options                if (isset($cfg['RestrictColumnTypes'][strtoupper($field['True_Type'])])                 && isset($cfg['RestrictFunctions'][$cfg['RestrictColumnTypes'][strtoupper($field['True_Type'])]])) {                    $current_func_type  = $cfg['RestrictColumnTypes'][strtoupper($field['True_Type'])];                    $dropdown           = $cfg['RestrictFunctions'][$current_func_type];                    $default_function   = $cfg['DefaultFunctions'][$current_func_type];                } else {                    $dropdown = array();                    $default_function   = '';                }                $dropdown_built = array();                $op_spacing_needed = FALSE;                // what function defined as default?                // for the first timestamp we don't set the default function                // if there is a default value for the timestamp                // (not including CURRENT_TIMESTAMP)                // and the column does not have the                // ON UPDATE DEFAULT TIMESTAMP attribute.                if ($field['True_Type'] == 'timestamp'                  && empty($field['Default'])                  && ! isset($analyzed_sql[0]['create_table_fields'][$field['Field']]['on_update_current_timestamp'])) {                    $default_function = $cfg['DefaultFunctions']['first_timestamp'];                }                if ($field['Key'] == 'PRI'                 && ($field['Type'] == 'char(36)' || $field['Type'] == 'varchar(36)')) {                     $default_function = $cfg['DefaultFunctions']['pk_char36'];                }                // garvin: loop on the dropdown array and print all available options for that field.                foreach ($dropdown as $each_dropdown){                    echo '<option';                    if ($default_function === $each_dropdown) {                        echo ' selected="selected"';                    }                    echo '>' . $each_dropdown . '</option>' . "\n";                    $dropdown_built[$each_dropdown] = 'TRUE';                    $op_spacing_needed = TRUE;                }                // garvin: For compatibility's sake, do not let out all other functions. Instead                // print a separator (blank) and then show ALL functions which weren't shown                // yet.                $cnt_functions = count($cfg['Functions']);                for ($j = 0; $j < $cnt_functions; $j++) {                    if (!isset($dropdown_built[$cfg['Functions'][$j]]) || $dropdown_built[$cfg['Functions'][$j]] != 'TRUE') {                        // Is current function defined as default?                        $selected = ($field['first_timestamp'] && $cfg['Functions'][$j] == $cfg['DefaultFunctions']['first_timestamp'])                                    || (!$field['first_timestamp'] && $cfg['Functions'][$j] == $default_function)                                  ? ' selected="selected"'                                  : '';                        if ($op_spacing_needed == TRUE) {                            echo '                ';                            echo '<option value="">--------</option>' . "\n";                            $op_spacing_needed = FALSE;                        }                        echo '                ';                        echo '<option' . $selected . '>' . $cfg['Functions'][$j] . '</option>' . "\n";                    }                } // end for                unset($selected);                ?>                </select>            </td>                <?php            }        } // end if ($cfg['ShowFunctionFields'])        // The null column        // ---------------        $foreignData = PMA_getForeignData($foreigners, $field['Field'], false, '', '');        echo '        <td>' . "\n";        if ($field['Null'] == 'YES') {            echo '            <input type="hidden" name="fields_null_prev' . $field_name_appendix . '"';            if ($real_null_value && !$field['first_timestamp']) {                echo ' value="on"';            }            echo ' />' . "\n";            if (!(($cfg['ProtectBinary'] && $field['is_blob']) || ($cfg['ProtectBinary'] == 'all' && $field['is_binary']))) {                echo '            <input type="checkbox" tabindex="' . ($tabindex + $tabindex_for_null) . '"'                     . ' name="fields_null' . $field_name_appendix . '"';                if ($real_null_value && !$field['first_timestamp']) {                    echo ' checked="checked"';                }                echo ' id="field_' . ($idindex) . '_2"';                $onclick         = ' onclick="if (this.checked) {nullify(';                if (strstr($field['True_Type'], 'enum')) {                    if (strlen($field['Type']) > 20) {

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -