📄 tbl_structure.php
字号:
if ($cfgRelation['commwork'] && $cfgRelation['mimework'] && $cfg['BrowseMIME'] && isset($mime_map[$row['Field']]['mimetype'])) { $type_mime = '<br />MIME: ' . str_replace('_', '/', $mime_map[$row['Field']]['mimetype']); } else { $type_mime = ''; } $attribute = ' '; if ($binary) { $attribute = 'BINARY'; } if ($unsigned) { $attribute = 'UNSIGNED'; } if ($zerofill) { $attribute = 'UNSIGNED ZEROFILL'; } // MySQL 4.1.2+ TIMESTAMP options // (if on_update_current_timestamp is set, then it's TRUE) if (isset($analyzed_sql[0]['create_table_fields'][$row['Field']]['on_update_current_timestamp'])) { $attribute = 'on update CURRENT_TIMESTAMP'; } // here, we have a TIMESTAMP that SHOW FULL FIELDS reports as having the // NULL attribute, but SHOW CREATE TABLE says the contrary. Believe // the latter. if (!empty($analyzed_sql[0]['create_table_fields'][$row['Field']]['type']) && $analyzed_sql[0]['create_table_fields'][$row['Field']]['type'] == 'TIMESTAMP' && $analyzed_sql[0]['create_table_fields'][$row['Field']]['timestamp_not_null']) { $row['Null'] = ''; } if (!isset($row['Default'])) { if ($row['Null'] == 'YES') { $row['Default'] = '<i>NULL</i>'; } } else { $row['Default'] = htmlspecialchars($row['Default']); } $field_encoded = urlencode($row['Field']); $field_name = htmlspecialchars($row['Field']); // garvin: underline commented fields and display a hover-title (CSS only) $comment_style = ''; if (isset($comments_map[$row['Field']])) { $field_name = '<span style="border-bottom: 1px dashed black;" title="' . htmlspecialchars($comments_map[$row['Field']]) . '">' . $field_name . '</span>'; } if ($primary && $primary->hasColumn($field_name)) { $field_name = '<u>' . $field_name . '</u>'; } echo "\n"; ?><tr class="<?php echo $odd_row ? 'odd': 'even'; $odd_row = !$odd_row; ?>"> <td align="center"> <input type="checkbox" name="selected_fld[]" value="<?php echo htmlspecialchars($row['Field']); ?>" id="checkbox_row_<?php echo $rownum; ?>" <?php echo $checked; ?> /> </td> <th nowrap="nowrap"><label for="checkbox_row_<?php echo $rownum; ?>"><?php echo $field_name; ?></label></th> <td<?php echo $type_nowrap; ?>><bdo dir="ltr" xml:lang="en"><?php echo $type; echo $type_mime; ?></bdo></td> <td><?php echo (empty($field_charset) ? '' : '<dfn title="' . PMA_getCollationDescr($field_charset) . '">' . $field_charset . '</dfn>'); ?></td> <td nowrap="nowrap" style="font-size: 70%"><?php echo $attribute; ?></td> <td><?php echo (($row['Null'] == 'YES') ? $strYes : $strNo); ?></td> <td nowrap="nowrap"><?php if (isset($row['Default'])) { if ($extracted_fieldspec['type'] == 'bit') { echo PMA_printable_bit_value($row['Default'], $extracted_fieldspec['spec_in_brackets']); } else { echo $row['Default']; } } else { echo '<i>' . $strNone . '</i>'; } ?></td> <td nowrap="nowrap"><?php echo $row['Extra']; ?></td> <td align="center"> <a href="sql.php?<?php echo $url_query; ?>&sql_query=<?php echo urlencode('SELECT COUNT(*) AS ' . PMA_backquote($strRows) . ', ' . PMA_backquote($row['Field']) . ' FROM ' . PMA_backquote($table) . ' GROUP BY ' . PMA_backquote($row['Field']) . ' ORDER BY ' . PMA_backquote($row['Field'])); ?>"> <?php echo $titles['BrowseDistinctValues']; ?></a> </td> <?php if (! $tbl_is_view && ! $db_is_information_schema) { ?> <td align="center"> <a href="tbl_alter.php?<?php echo $url_query; ?>&field=<?php echo $field_encoded; ?>"> <?php echo $titles['Change']; ?></a> </td> <td align="center"> <a href="sql.php?<?php echo $url_query; ?>&sql_query=<?php echo urlencode('ALTER TABLE ' . PMA_backquote($table) . ' DROP ' . PMA_backquote($row['Field'])); ?>&cpurge=1&purgekey=<?php echo urlencode($row['Field']); ?>&zero_rows=<?php echo urlencode(sprintf($strFieldHasBeenDropped, htmlspecialchars($row['Field']))); ?>" onclick="return confirmLink(this, 'ALTER TABLE <?php echo PMA_jsFormat($table); ?> DROP <?php echo PMA_jsFormat($row['Field']); ?>')"> <?php echo $titles['Drop']; ?></a> </td> <td align="center"> <?php if ($type == 'text' || $type == 'blob' || 'ARCHIVE' == $tbl_type) { echo $titles['NoPrimary'] . "\n"; } else { echo "\n"; ?> <a href="sql.php?<?php echo $url_query; ?>&sql_query=<?php echo urlencode('ALTER TABLE ' . PMA_backquote($table) . ($primary ? ' DROP PRIMARY KEY,' : '') . ' ADD PRIMARY KEY(' . PMA_backquote($row['Field']) . ')'); ?>&zero_rows=<?php echo urlencode(sprintf($strAPrimaryKey, htmlspecialchars($row['Field']))); ?>" onclick="return confirmLink(this, 'ALTER TABLE <?php echo PMA_jsFormat($table) . ($primary ? ' DROP PRIMARY KEY,' : ''); ?> ADD PRIMARY KEY(<?php echo PMA_jsFormat($row['Field']); ?>)')"> <?php echo $titles['Primary']; ?></a> <?php } echo "\n"; ?> </td> <td align="center"> <?php if ($type == 'text' || $type == 'blob' || 'ARCHIVE' == $tbl_type) { echo $titles['NoUnique'] . "\n"; } else { echo "\n"; ?> <a href="sql.php?<?php echo $url_query; ?>&sql_query=<?php echo urlencode('ALTER TABLE ' . PMA_backquote($table) . ' ADD UNIQUE(' . PMA_backquote($row['Field']) . ')'); ?>&zero_rows=<?php echo urlencode(sprintf($strAnIndex, htmlspecialchars($row['Field']))); ?>"> <?php echo $titles['Unique']; ?></a> <?php } echo "\n"; ?> </td> <td align="center"> <?php if ($type == 'text' || $type == 'blob' || 'ARCHIVE' == $tbl_type) { echo $titles['NoIndex'] . "\n"; } else { echo "\n"; ?> <a href="sql.php?<?php echo $url_query; ?>&sql_query=<?php echo urlencode('ALTER TABLE ' . PMA_backquote($table) . ' ADD INDEX(' . PMA_backquote($row['Field']) . ')'); ?>&zero_rows=<?php echo urlencode(sprintf($strAnIndex, htmlspecialchars($row['Field']))); ?>"> <?php echo $titles['Index']; ?></a> <?php } echo "\n"; ?> </td> <?php if (! empty($tbl_type) && ($tbl_type == 'MYISAM' || $tbl_type == 'MARIA') // FULLTEXT is possible on TEXT, CHAR and VARCHAR && (strpos(' ' . $type, 'text') || strpos(' ' . $type, 'char'))) { echo "\n"; ?> <td align="center" nowrap="nowrap"> <a href="sql.php?<?php echo $url_query; ?>&sql_query=<?php echo urlencode('ALTER TABLE ' . PMA_backquote($table) . ' ADD FULLTEXT(' . PMA_backquote($row['Field']) . ')'); ?>&zero_rows=<?php echo urlencode(sprintf($strAnIndex, htmlspecialchars($row['Field']))); ?>"> <?php echo $titles['IdxFulltext']; ?></a> </td> <?php } else { echo "\n"; ?> <td align="center" nowrap="nowrap"> <?php echo $titles['NoIdxFulltext'] . "\n"; ?> </td> <?php } // end if... else... echo "\n"; } // end if (! $tbl_is_view && ! $db_is_information_schema) ?></tr> <?php unset($field_charset);} // end whileecho '</tbody>' . "\n" .'</table>' . "\n";$checkall_url = 'tbl_structure.php?' . PMA_generate_common_url($db, $table);?><img class="selectallarrow" src="<?php echo $pmaThemeImage . 'arrow_' . $text_dir . '.png'; ?>" width="38" height="22" alt="<?php echo $strWithChecked; ?>" /><a href="<?php echo $checkall_url; ?>&checkall=1" onclick="if (markAllRows('fieldsForm')) return false;"> <?php echo $strCheckAll; ?></a>/<a href="<?php echo $checkall_url; ?>" onclick="if (unMarkAllRows('fieldsForm')) return false;"> <?php echo $strUncheckAll; ?></a><i><?php echo $strWithChecked; ?></i><?phpPMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_browse', $strBrowse, 'b_browse.png');if (! $tbl_is_view && ! $db_is_information_schema) { PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_change', $strChange, 'b_edit.png'); PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_drop', $strDrop, 'b_drop.png'); if ('ARCHIVE' != $tbl_type) { PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_primary', $strPrimary, 'b_primary.png'); PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_unique', $strUnique, 'b_unique.png'); PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_index', $strIndex, 'b_index.png'); } if (! empty($tbl_type) && ($tbl_type == 'MYISAM' || $tbl_type == 'MARIA')) { PMA_buttonOrImage('submit_mult', 'mult_submit', 'submit_mult_fulltext', $strIdxFulltext, 'b_ftext.png'); }}?></form><hr /><?php/** * Work on the table */?><a href="tbl_printview.php?<?php echo $url_query; ?>"><?phpif ($cfg['PropertiesIconic']) { echo '<img class="icon" src="' . $pmaThemeImage . 'b_print.png" width="16" height="16" alt="' . $strPrintView . '"/>';}echo $strPrintView;?></a><?phpif (! $tbl_is_view && ! $db_is_information_schema) { // if internal relations are available, or foreign keys are supported // ($tbl_type comes from libraries/tbl_info.inc.php) if ($cfgRelation['relwork'] || PMA_foreignkey_supported($tbl_type)) { ?><a href="tbl_relation.php?<?php echo $url_query; ?>"><?php if ($cfg['PropertiesIconic']) { echo '<img class="icon" src="' . $pmaThemeImage . 'b_relations.png" width="16" height="16" alt="' . $strRelationView . '"/>'; } echo $strRelationView; ?></a> <?php } ?><a href="sql.php?<?php echo $url_query; ?>&session_max_rows=all&sql_query=<?php echo urlencode('SELECT * FROM ' . PMA_backquote($table) . ' PROCEDURE ANALYSE()'); ?>"><?php if ($cfg['PropertiesIconic']) { echo '<img class="icon" src="' . $pmaThemeImage . 'b_tblanalyse.png" width="16" height="16" alt="' . $strStructPropose . '" />'; } echo $strStructPropose; ?></a><?php echo PMA_showMySQLDocu('Extending_MySQL', 'procedure_analyse') . "\n"; ?><br /><form method="post" action="tbl_addfield.php" onsubmit="return checkFormElementInRange(this, 'num_fields', '<?php echo str_replace('\'', '\\\'', $GLOBALS['strInvalidFieldAddCount']); ?>', 1)"> <?php echo PMA_generate_common_hidden_inputs($db, $table); if ($cfg['PropertiesIconic']) { echo '<img class="icon" src="' . $pmaThemeImage . 'b_insrow.png" width="16" height="16" alt="' . $strAddNewField . '"/>'; } echo sprintf($strAddFields, '<input type="text" name="num_fields" size="2" maxlength="2" value="1" style="vertical-align: middle" onfocus="this.select()" />'); // I tried displaying the drop-down inside the label but with Firefox // the drop-down was blinking $fieldOptions = '<select name="after_field" style="vertical-align: middle" onclick="this.form.field_where[2].checked=true" onchange="this.form.field_where[2].checked=true">'; foreach ($aryFields as $fieldname) { $fieldOptions .= '<option value="' . htmlspecialchars($fieldname) . '">' . htmlspecialchars($fieldname) . '</option>' . "\n"; } unset($aryFields); $fieldOptions .= '</select>'; $choices = array( 'last' => $strAtEndOfTable, 'first' => $strAtBeginningOfTable, 'after' => sprintf($strAfter, '') ); PMA_generate_html_radio('field_where', $choices, 'last', false); echo $fieldOptions; unset($fieldOptions, $choices); ?><input type="submit" value="<?php echo $strGo; ?>" style="vertical-align: middle" /></form><hr /> <?php}/** * If there are more than 20 rows, displays browse/select/insert/empty/drop * links again */if ($fields_cnt > 20) { require './libraries/tbl_links.inc.php';} // end if ($fields_cnt > 20)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -