From c495cc52a37267dedeffb20a6030b288f2bbdab9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Chapeaux?= Date: Fri, 7 Sep 2001 19:38:45 +0000 Subject: [PATCH] * the 'location' header must be above any output! * line 456: fixed an invalid link to the official MySQL documentation; * added background color for indexes; * removed the Browse/Select/Insert/Empty links at the middle of the page. * $reload has now true boolean values --- tbl_properties.php3 | 129 ++++++++++++++++++++++---------------------- 1 file changed, 64 insertions(+), 65 deletions(-) diff --git a/tbl_properties.php3 b/tbl_properties.php3 index 10123b657..d3fc40d6e 100755 --- a/tbl_properties.php3 +++ b/tbl_properties.php3 @@ -3,10 +3,30 @@ /** - * Gets some core libraries and diplays headers + * Gets some core libraries, ensures the database and the table exist (else + * move to the "parent" script) and diplays headers */ require('./grab_globals.inc.php3'); require('./lib.inc.php3'); +// Not a valid db name -> back to the welcome page +if (!empty($db)) { + $is_db = @mysql_select_db($db); +} +if (empty($db) || !$is_db) { + header('Location: ' . $cfgPmaAbsoluteUri . 'main.php3?lang=' . $lang . '&server=' . $server . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1'); + exit(); +} +// Not a valid table name -> back to the db_details.php3 +if (!empty($table)) { + $is_table = @mysql_query('SHOW TABLES LIKE \'' . sql_addslashes($table, TRUE) . '\''); +} +if (empty($table) || !@mysql_numrows($is_table)) { + header('Location: ' . $cfgPmaAbsoluteUri . 'db_details.php3?lang=' . $lang . '&server=' . $server . '&db=' . urlencode($db) . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1'); + exit(); +} else if (isset($is_table)) { + mysql_free_result($is_table); +} +// Displays headers if (!isset($message)) { $js_to_run = 'functions.js'; include('./header.inc.php3'); @@ -46,29 +66,6 @@ if (isset($show_query) && $show_query == 'y') { unset($sql_query); -/** - * Selects the db that will be used during this script execution - */ -// Not a valid db name -> back to the welcome page -if (!empty($db)) { - $is_db = @mysql_select_db($db); -} -if (empty($db) || !$is_db) { - header('Location: ' . $cfgPmaAbsoluteUri . 'main.php3?lang=' . $lang . '&server=' . $server . '&reload=true'); - exit(); -} -// Not a valid table name -> back to the db_details.php3 -if (!empty($table)) { - $is_table = @mysql_query('SHOW TABLES LIKE \'' . sql_addslashes($table, TRUE) . '\''); -} -if (empty($table) || !@mysql_numrows($is_table)) { - header('Location: ' . $cfgPmaAbsoluteUri . 'db_details.php3?lang=' . $lang . '&server=' . $server . '&db=' . urlencode($db) . '&reload=true'); - exit(); -} else if (isset($is_table)) { - mysql_free_result($is_table); -} - - /** * Set parameters for links */ @@ -138,8 +135,8 @@ if ($num_rows > 0) { ]    [ - ]    - [ ]       + [ ]

@@ -153,8 +150,8 @@ if ($num_rows > 0) { [ ]    [ ]    - [ ]    - [ ]  *   + [ ]

@@ -179,7 +176,7 @@ $prev_key = ''; $prev_seq = 0; $i = 0; $pk_array = array(); // will be use to emphasis prim. keys in the table view -while($row = mysql_fetch_array($result)) { +while ($row = mysql_fetch_array($result)) { $ret_keys[] = $row; // Unset the 'Seq_in_index' value if it's not a composite index - part 1 if ($i > 0 && $row['Key_name'] != $prev_key && $prev_seq == 1) { @@ -193,7 +190,7 @@ while($row = mysql_fetch_array($result)) { $pk_array[$row['Column_name']] = 1; } $i++; -} +} // end while // Unset the 'Seq_in_index' value if it's not a composite index - part 2 if ($i > 0 && $row['Key_name'] != $prev_key && $prev_seq == 1) { unset($ret_keys[$i-1]['Seq_in_index']); @@ -230,7 +227,7 @@ $fields_cnt = mysql_num_rows($result); - + &sql_query=&zero_rows=" onclick="return confirmLink(this, 'ALTER TABLE DROP ')"> - &sql_query=&zero_rows="> - = 32323) { echo "\n"; ?> @@ -350,7 +347,7 @@ echo "\n"; ?> - + <?php echo $strWithChecked; ?>    @@ -407,8 +404,10 @@ if ($index_count > 0) {  -' . $row['Seq_in_index'] . '-'; } else { @@ -426,9 +425,15 @@ if ($index_count > 0) { $js_msg = 'ALTER TABLE ' . js_format($table) . ' DROP INDEX ' . js_format($row['Key_name']); $zero_rows = urlencode($strIndex . ' ' . htmlspecialchars($row['Key_name']) . ' ' . $strHasBeenDropped); } + + if ($row['Key_name'] != $prev_key) { + $j++; + $prev_key = $row['Key_name']; + } + $bgcolor = ($j % 2) ? $cfgBgcolorOne : $cfgBgcolorTwo; echo "\n"; ?> - + 0) { ?> + } + if (!empty($row['Sub_part'])) { + echo "\n"; + ?>   + + + " onclick="return confirmLink(this, '')"> @@ -449,14 +464,14 @@ if ($index_count > 0) { - + 0) { echo " $strOr $strBookmarkQuery :
\n"; echo '
' . "\n"; @@ -726,22 +741,6 @@ if ($cfgBookmark['db'] && $cfgBookmark['table']) { - -
  • -
    - -  -  - -  -  - -  -  - - -
    -
    -
  • -
  • - +
    @@ -932,7 +931,7 @@ echo "\n"; - +
    @@ -1108,9 +1107,9 @@ if (MYSQL_INT_VERSION >= 32322) { = 3.23 +} // end MySQL >= 3.23.22 -else { // MySQL < 3.23 +else { // MySQL < 3.23.22 // FIXME: find a way to know the table type, then let OPTIMIZE if MYISAM or // BDB ?> @@ -1125,12 +1124,12 @@ else { // MySQL < 3.23
  • -