1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-17 03:53:59 +02:00

Export SQL command result (bug #3116854)

This commit is contained in:
Jakub Vrana
2011-02-15 17:22:50 +01:00
parent 0836c34aef
commit 15715b32ff
3 changed files with 33 additions and 14 deletions

View File

@@ -612,13 +612,19 @@ DROP PROCEDURE adminer_alter;
if ($_POST["format"] == "sql" && $style == "TRUNCATE+INSERT") {
echo truncate_sql($table) . ";\n";
}
$fields = fields($table);
if ($_POST["format"] == "sql") {
$fields = fields($table);
}
$result = $connection->query($query, 1); // 1 - MYSQLI_USE_RESULT //! enum and set as numbers
if ($result) {
$insert = "";
$buffer = "";
while ($row = $result->fetch_assoc()) {
if ($_POST["format"] != "sql") {
if ($style == "table") {
dump_csv(array_keys($row));
$style = "INSERT";
}
dump_csv($row);
} else {
if (!$insert) {