diff --git a/adminer/include/export.inc.php b/adminer/include/export.inc.php
index faf907bf..00b0b52c 100644
--- a/adminer/include/export.inc.php
+++ b/adminer/include/export.inc.php
@@ -157,6 +157,6 @@ function dump_headers($identifier, $multi_table = false) {
return $ext;
}
-$dump_output = "";
-$dump_format = "";
+$dump_output = "";
+$dump_output = "";
$max_packet = 1048576; // default, minimum is 1024
diff --git a/adminer/select.inc.php b/adminer/select.inc.php
index ce640054..1eec2639 100644
--- a/adminer/select.inc.php
+++ b/adminer/select.inc.php
@@ -35,6 +35,9 @@ if ($_POST && !$error) {
if ($_POST["export"]) {
dump_headers($_GET["select"]);
dump_table($_GET["select"], "");
+ if ($_POST["format"] != "sql") { // Editor doesn't send format
+ dump_csv($select ? $select : array_keys($fields));
+ }
if (!is_array($_POST["check"]) || $primary === array()) {
dump_data($_GET["select"], "INSERT", "SELECT $from" . (is_array($_POST["check"]) ? ($where ? " AND " : " WHERE ") . "($where_check)" : "") . $group_by);
} else {
diff --git a/editor/include/export.inc.php b/editor/include/export.inc.php
index 984159f1..f9dcdb9d 100644
--- a/editor/include/export.inc.php
+++ b/editor/include/export.inc.php
@@ -1,7 +1,6 @@