From f1153aa35a0797159bc8c8c52195c0c955f8aa52 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Fri, 27 Jul 2012 17:37:04 -0700 Subject: [PATCH] Display assigned auto_increment after clone --- adminer/select.inc.php | 11 +++++++++-- changes.txt | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/adminer/select.inc.php b/adminer/select.inc.php index a1d3737f..768e5fa3 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -106,7 +106,7 @@ if ($_POST && !$error) { $query = "INTO $query"; } if ($_POST["all"] || ($unselected === array() && $_POST["check"]) || count($group) < count($select)) { - $result = queries($command . " $query" . ($_POST["all"] ? ($where ? "\nWHERE " . implode(" AND ", $where) : "") : "\nWHERE $where_check")); + $result = queries("$command $query" . ($_POST["all"] ? ($where ? "\nWHERE " . implode(" AND ", $where) : "") : "\nWHERE $where_check")); $affected = $connection->affected_rows; } else { foreach ((array) $_POST["check"] as $val) { @@ -119,7 +119,14 @@ if ($_POST && !$error) { } } } - queries_redirect(remove_from_uri("page"), lang('%d item(s) have been affected.', $affected), $result); + $message = lang('%d item(s) have been affected.', $affected); + if ($_POST["clone"] && $result && $affected == 1) { + $last_id = last_id(); + if ($last_id) { + $message = lang('Item%s has been inserted.', " $last_id"); + } + } + queries_redirect(remove_from_uri("page"), $message, $result); //! display edit page in case of an error } elseif (!$_POST["import"]) { // modify if (!$_POST["val"]) { diff --git a/changes.txt b/changes.txt index 60b0ca40..94265583 100644 --- a/changes.txt +++ b/changes.txt @@ -1,4 +1,5 @@ Adminer 3.4.1-dev: +Display assigned auto_increment after clone SQLite: Full alter table SQLite: Better editing in tables without a primary key