]> git.joonet.de Git - adminer.git/commitdiff
Display assigned auto_increment after clone
authorJakub Vrana <jakub@vrana.cz>
Sat, 28 Jul 2012 00:37:04 +0000 (17:37 -0700)
committerJakub Vrana <jakub@vrana.cz>
Sat, 28 Jul 2012 00:37:20 +0000 (17:37 -0700)
adminer/select.inc.php
changes.txt

index a1d3737fe0150dc61fe1d8dd63554a5e4067407a..768e5fa3f491b0c53bcae1ade037879b8c081a38 100644 (file)
@@ -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"]) {
index 60b0ca40476b997116b101f2d5ad337b3a791269..94265583a1536abca0b35777f9db741a8b530be6 100644 (file)
@@ -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