Export Output in select.inc.php

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@447 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana
2008-08-18 15:18:16 +00:00
parent ec23248c51
commit 9890b6c22d
4 changed files with 39 additions and 29 deletions

View File

@@ -64,8 +64,7 @@ if ($_POST && !$error) {
$result = true;
$deleted = 0;
if ($_POST["export"] || $_POST["export_result"]) {
header("Content-Type: text/plain; charset=utf-8");
header("Content-Disposition: inline; filename=" . preg_replace('~[^a-z0-9_]~i', '-', $_GET["select"]) . "." . ($_POST["format"] == "sql" ? "sql" : "csv"));
dump_headers($_GET["select"]);
}
if (isset($_POST["truncate"])) {
$result = $mysql->query($where ? "DELETE FROM " . idf_escape($_GET["select"]) . " WHERE " . implode(" AND ", $where) : "TRUNCATE " . idf_escape($_GET["select"]));