1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-11 17:14:07 +02:00

Dump column names in CSV select export

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1010 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana
2009-08-25 14:11:15 +00:00
parent d0681c1d50
commit e4f5d17eec
3 changed files with 5 additions and 3 deletions

View File

@@ -157,6 +157,6 @@ function dump_headers($identifier, $multi_table = false) {
return $ext;
}
$dump_output = "<select name='output'><option value='text'>" . lang('open') . "<option value='file'>" . lang('save') . "</select>";
$dump_format = "<select name='format'><option value='sql'>" . lang('SQL') . "<option value='csv'>" . lang('CSV') . "</select>";
$dump_output = "<select name='output'>" . optionlist(array('text' => lang('open'), 'file' => lang('save'))) . "</select>";
$dump_output = "<select name='output'>" . optionlist(array('sql' => lang('SQL'), 'csv' => lang('CSV'))) . "</select>";
$max_packet = 1048576; // default, minimum is 1024

View File

@@ -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 {

View File

@@ -1,7 +1,6 @@
<?php
function dump_table($table) {
echo "\xef\xbb\xbf"; // UTF-8 byte order mark
dump_csv(array_keys(fields($table)));
}
function dump_data($table, $style, $select = "") {