From e4f5d17eece82965edd85f81195580f2a97e16c7 Mon Sep 17 00:00:00 2001 From: jakubvrana Date: Tue, 25 Aug 2009 14:11:15 +0000 Subject: [PATCH] Dump column names in CSV select export git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1010 7c3ca157-0c34-0410-bff1-cbf682f78f5c --- adminer/include/export.inc.php | 4 ++-- adminer/select.inc.php | 3 +++ editor/include/export.inc.php | 1 - 3 files changed, 5 insertions(+), 3 deletions(-) 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 @@