$existing) { if ($index["type"] == $existing["type"] && $existing["columns"] == $columns) { unset($indexes[$name]); continue 2; } } $alter[] = "ADD $index[type]" . ($index["type"] == "PRIMARY" ? " KEY" : "") . " (" . implode(", ", array_map('idf_escape', $columns)) . ")"; } } } foreach ($indexes as $name => $existing) { $alter[] = "DROP INDEX " . idf_escape($name); } if (!$alter || mysql_query("ALTER TABLE " . idf_escape($_GET["indexes"]) . " " . implode(", ", $alter))) { redirect($SELF . "table=" . urlencode($_GET["indexes"]), ($alter ? lang('Indexes has been altered.') : null)); } $error = mysql_error(); } page_header(lang('Indexes') . ': ' . htmlspecialchars($_GET["indexes"])); if ($_POST) { if (!$_POST["add"]) { echo "

" . lang('Unable to operate indexes') . ": " . htmlspecialchars($error) . "

\n"; } $row = $_POST; } else { $row = array("indexes" => $indexes); } ?>
\n"; $j++; } } //! JavaScript for adding more indexes and columns ?>
"; ksort($index["columns"]); foreach ($index["columns"] as $i => $column) { if (strlen($column)) { echo ""; } } echo ""; echo "