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

Simplify dumpOutput, dumpFormat and dumpData methods

This commit is contained in:
Jakub Vrana
2010-10-29 17:11:00 +02:00
parent 095d472366
commit be3410f822
4 changed files with 20 additions and 23 deletions

View File

@@ -434,21 +434,21 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
return $return;
}
function dumpOutput($select, $value = "") {
return "";
function dumpOutput() {
return array();
}
function dumpFormat($select, $value = "") {
return html_select("format", array('csv' => 'CSV,', 'csv;' => 'CSV;'), $value, $select);
function dumpFormat() {
return array('csv' => 'CSV,', 'csv;' => 'CSV;');
}
function dumpTable() {
echo "\xef\xbb\xbf"; // UTF-8 byte order mark
}
function dumpData($table, $style, $select = "") {
function dumpData($table, $style, $query) {
global $connection;
$result = $connection->query(($select ? $select : "SELECT * FROM " . idf_escape($table)), 1); // 1 - MYSQLI_USE_RESULT
$result = $connection->query($query, 1); // 1 - MYSQLI_USE_RESULT
if ($result) {
while ($row = $result->fetch_assoc()) {
dump_csv($row);