diff --git a/adminer/select.inc.php b/adminer/select.inc.php
index bcde4e77..56f45dd3 100644
--- a/adminer/select.inc.php
+++ b/adminer/select.inc.php
@@ -7,6 +7,7 @@ $foreign_keys = column_foreign_keys($TABLE);
if ($table_status["Oid"] == "t") {
$indexes[] = array("type" => "PRIMARY", "columns" => array("oid"));
}
+parse_str($_COOKIE["adminer_import"], $adminer_import);
$rights = array(); // privilege => 0
$columns = array(); // selectable columns
@@ -53,6 +54,7 @@ if ($_POST && !$error) {
}
}
if ($_POST["export"]) {
+ cookie("adminer_import", "output=" . urlencode($_POST["output"]) . "&format=" . urlencode($_POST["format"]));
dump_headers($TABLE);
$adminer->dumpTable($TABLE, "");
if (!is_array($_POST["check"]) || $unselected === array()) {
@@ -141,6 +143,7 @@ if ($_POST && !$error) {
}
} elseif (is_string($file = get_file("csv_file", true))) {
//! character set
+ cookie("adminer_import", "output=" . urlencode($adminer_import["output"]) . "&format=" . urlencode($_POST["separator"]));
$result = true;
$cols = array_keys($fields);
preg_match_all('~(?>"[^"]*"|[^"\\r\\n]+)+~', $file, $matches);
@@ -367,8 +370,6 @@ if (!$columns) {
echo "\n";
}
- parse_str($_COOKIE["adminer_export"], $adminer_export);
-
if ($rows || $page) {
$exact_count = true;
if ($_GET["page"] != "last" && +$limit && count($group) >= count($select) && ($found_rows >= $limit || $page)) {
@@ -407,15 +408,15 @@ if (!$columns) {
}
print_fieldset("export", lang('Export'));
$output = $adminer->dumpOutput();
- echo ($output ? html_select("output", $output, $adminer_export["output"]) . " " : "");
- echo html_select("format", $adminer->dumpFormat(), $adminer_export["format"]);
+ echo ($output ? html_select("output", $output, $adminer_import["output"]) . " " : "");
+ echo html_select("format", $adminer->dumpFormat(), $adminer_import["format"]);
echo " \n";
echo "\n";
}
if ($adminer->selectImportPrint()) {
print_fieldset("import", lang('Import'), !$rows);
echo " ";
- echo html_select("separator", array("csv" => "CSV,", "csv;" => "CSV;", "tsv" => "TSV"), $adminer_export["format"], 1); // 1 - select
+ echo html_select("separator", array("csv" => "CSV,", "csv;" => "CSV;", "tsv" => "TSV"), $adminer_import["format"], 1); // 1 - select
echo " ";
echo "\n";
echo "\n";
diff --git a/changes.txt b/changes.txt
index 3e581cb9..5a8682c4 100644
--- a/changes.txt
+++ b/changes.txt
@@ -9,6 +9,7 @@ Display default column value in table overview
Display column collation in tooltip
Keyboard shortcuts: Alt+Shift+1 for homepage, Ctrl+Shift+Enter for Save and continue edit
Show only errors with Webserver file SQL command
+Remember select export and import options
Display error with all wrong SQL commands (MySQL)
Display foreign keys from other schemas (PostgreSQL)
Pagination support (Oracle)