diff --git a/create.inc.php b/create.inc.php index 06195caa..2ac1a29f 100644 --- a/create.inc.php +++ b/create.inc.php @@ -1,5 +1,5 @@ free(); if ($_POST) { $row = $_POST; ksort($row["fields"]); - if (!$_POST["add"]) { - echo "
" . lang('Unable to operate table') . ": " . htmlspecialchars($error) . "
\n"; - $row["fields"] = array_values($row["fields"]); - } else { + $row["fields"] = array_values($row["fields"]); + if ($_POST["add"]) { array_splice($row["fields"], key($_POST["add"]), 0, array(array())); + } elseif (!$_POST["drop_col"]) { + echo "" . lang('Unable to operate table') . ": " . htmlspecialchars($error) . "
\n"; } if ($row["auto_increment_col"]) { $row["fields"][$row["auto_increment_col"] - 1]["auto_increment"] = true; diff --git a/editing.inc.php b/editing.inc.php index 34fe6ab3..ae455c0b 100644 --- a/editing.inc.php +++ b/editing.inc.php @@ -102,14 +102,14 @@ function edit_fields($fields, $collations, $type = "TABLE") { ?>" . lang('Unable to operate routine') . ": " . htmlspecialchars($error) . "
\n"; - $row["fields"] = array_values($row["fields"]); - } else { + $row["fields"] = array_values($row["fields"]); + if ($_POST["add"]) { array_splice($row["fields"], key($_POST["add"]), 0, array(array())); + } elseif (!$_POST["drop_col"]) { + echo "" . lang('Unable to operate routine') . ": " . htmlspecialchars($error) . "
\n"; } } elseif (strlen($_GET["procedure"])) { $row = routine($_GET["procedure"], $routine);