1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-16 03:24:01 +02:00

Move common functions

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@789 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana
2009-07-03 09:16:50 +00:00
parent 0f850a658f
commit 61640ee6d7
5 changed files with 137 additions and 111 deletions

View File

@@ -0,0 +1,27 @@
<?php
function dump_table($table, $style, $is_view = false) {
echo "\xef\xbb\xbf"; // UTF-8 byte order mark
dump_csv(array_keys(fields($table)));
}
function dump_data($table, $style, $select = "") {
global $dbh;
$result = $dbh->query(($select ? $select : "SELECT * FROM " . idf_escape($table)));
if ($result) {
while ($row = $result->fetch_assoc()) {
dump_csv($row);
}
$result->free();
}
}
function dump_headers($identifier, $multi_table = false) {
$filename = (strlen($identifier) ? friendly_url($identifier) : "dump");
$ext = "csv";
header("Content-Type: text/csv; charset=utf-8");
header("Content-Disposition: attachment; filename=$filename.$ext");
return $ext;
}
$dump_output = "";
$dump_format = "";