1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-08 15:47:00 +02:00

TSV export and import (bug #3097657)

This commit is contained in:
Jakub Vrana
2010-10-29 18:02:20 +02:00
parent 772f71a780
commit e225d22f97
5 changed files with 8 additions and 7 deletions

View File

@@ -697,11 +697,11 @@ function search_tables() {
*/
function dump_csv($row) {
foreach ($row as $key => $val) {
if (preg_match("~[\"\n,;]~", $val) || $val === "") {
if (preg_match("~[\"\n,;\t]~", $val) || $val === "") {
$row[$key] = '"' . str_replace('"', '""', $val) . '"';
}
}
echo implode(($_POST["format"] == "csv" ? "," : ";"), $row) . "\n";
echo implode(($_POST["format"] == "csv" ? "," : ($_POST["format"] == "tsv" ? "\t" : ";")), $row) . "\n";
}
/** Apply SQL function