diff --git a/adminer/dump.inc.php b/adminer/dump.inc.php index 137bd0ec..cc67e9ff 100644 --- a/adminer/dump.inc.php +++ b/adminer/dump.inc.php @@ -156,7 +156,7 @@ page_header(lang('Export'), "", ($_GET["export"] != "" ? array("table" => $_GET[ $db_style = array('', 'USE', 'DROP+CREATE', 'CREATE'); $table_style = array('', 'DROP+CREATE', 'CREATE'); $data_style = array('', 'TRUNCATE+INSERT', 'INSERT', 'INSERT+UPDATE'); -if (support("routine")) { +if ($driver == "sql") { $db_style[] = 'CREATE+ALTER'; $table_style[] = 'CREATE+ALTER'; } diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php index 0fd866da..8374b835 100644 --- a/adminer/include/functions.inc.php +++ b/adminer/include/functions.inc.php @@ -598,7 +598,7 @@ function dump_csv($row) { $row[$key] = '"' . str_replace('"', '""', $val) . '"'; } } - echo implode(($_POST["format"] == "csv;" ? ";" : ","), $row) . "\n"; + echo implode(($_POST["format"] == "csv" ? "," : ";"), $row) . "\n"; } /** Apply SQL function diff --git a/adminer/select.inc.php b/adminer/select.inc.php index 508bccc0..57a18db0 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -112,7 +112,7 @@ if ($_POST && !$error) { preg_match_all('~(?>"[^"]*"|[^"\\r\\n]+)+~', $file, $matches); $affected = count($matches[0]); queries("START TRANSACTION"); - $separator = ($_POST["separator"] == ";" ? ";" : ","); + $separator = ($_POST["separator"] == "csv" ? "," : ";"); foreach ($matches[0] as $key => $val) { preg_match_all("~((\"[^\"]*\")+|[^$separator]*)$separator~", $val . $separator, $matches2); if (!$key && !array_diff($matches2[1], $cols)) { //! doesn't work with column names containing ",\n @@ -132,7 +132,7 @@ if ($_POST && !$error) { } } if ($result) { - queries("COMMIT"); + queries("COMMIT"); } queries_redirect(remove_from_uri("page"), lang('%d row(s) have been imported.', $affected), $result); queries("ROLLBACK"); @@ -327,7 +327,7 @@ if (!$columns) { } print_fieldset("import", lang('CSV Import'), !$result->num_rows); echo " "; - echo html_select("separator", array(",", ";"), ($adminer_export["format"] == "csv;" ? ";" : ","), 1); // 1 - select + echo html_select("separator", array("csv" => "CSV,", "csv;" => "CSV;"), $adminer_export["format"], 1); // 1 - select echo " \n"; echo "\n";