diff --git a/create.inc.php b/create.inc.php index 4967277c..cdcf2e42 100644 --- a/create.inc.php +++ b/create.inc.php @@ -43,7 +43,7 @@ if ($_POST) { } else { $row = array("fields" => array()); } -//! collate columns, references, indexes, unsigned, zerofill, default +//! collate columns, references, unsigned, zerofill, default ?>

diff --git a/index.php b/index.php index 58e20085..6bcb10fa 100644 --- a/index.php +++ b/index.php @@ -17,6 +17,8 @@ if (isset($_GET["sql"])) { include "./edit.inc.php"; } elseif (isset($_GET["create"])) { include "./create.inc.php"; +} elseif (isset($_GET["indexes"])) { + include "./indexes.inc.php"; } elseif (isset($_GET["dump"])) { include "./dump.inc.php"; } elseif (isset($_GET["view"])) { diff --git a/indexes.inc.php b/indexes.inc.php new file mode 100644 index 00000000..4e741249 --- /dev/null +++ b/indexes.inc.php @@ -0,0 +1,38 @@ +" . lang('Indexes') . ': ' . htmlspecialchars($_GET["indexes"]) . "\n"; + +if ($_POST) { + echo "

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

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

+
diff --git a/table.inc.php b/table.inc.php index 5d274953..f1241cd6 100644 --- a/table.inc.php +++ b/table.inc.php @@ -11,9 +11,9 @@ echo "\n"; mysql_free_result($result); echo '

' . lang('Alter table') . "

\n"; +echo "

" . lang('Indexes') . "

\n"; $indexes = indexes($_GET["table"]); if ($indexes) { - echo "

" . lang('Indexes') . "

\n"; echo "\n"; foreach ($indexes as $type => $index) { foreach ($index as $columns) { @@ -23,6 +23,7 @@ if ($indexes) { } echo "
\n"; } +echo '

' . lang('Alter indexes') . "

\n"; $result = mysql_query("SELECT * FROM information_schema.KEY_COLUMN_USAGE WHERE TABLE_SCHEMA = '" . mysql_real_escape_string($_GET["db"]) . "' AND TABLE_NAME = '" . mysql_real_escape_string($_GET["table"]) . "' AND REFERENCED_TABLE_NAME IS NOT NULL ORDER BY ORDINAL_POSITION"); if (mysql_num_rows($result)) {