diff --git a/tbl_move_copy.php b/tbl_move_copy.php
index 02f44c482..b8404646c 100644
--- a/tbl_move_copy.php
+++ b/tbl_move_copy.php
@@ -26,6 +26,14 @@ $err_url = 'tbl_sql.php?' . PMA_generate_common_url($db, $table);
*/
PMA_DBI_select_db($db);
+/**
+ * $target_db could be empty in case we came from an input field
+ * (when there are many databases, no drop-down)
+ */
+if (empty($target_db)) {
+ $target_db = $db;
+}
+
/**
* A target table name has been sent to this script -> do the work
*/
diff --git a/tbl_operations.php b/tbl_operations.php
index e73a30b54..4dab6a1a4 100644
--- a/tbl_operations.php
+++ b/tbl_operations.php
@@ -190,7 +190,7 @@ unset($columns);
count() > $GLOBALS['cfg']['MaxDbList']) {
?>
-
+
@@ -353,7 +353,7 @@ if (isset($auto_increment) && strlen($auto_increment) > 0
count() > $GLOBALS['cfg']['MaxDbList']) {
?>
-
+