1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-12 09:34:10 +02:00

Utilize single parameter implode

This commit is contained in:
Jakub Vrana
2010-05-07 18:10:35 +02:00
parent 5050de574f
commit 7f3ccd3b51
4 changed files with 5 additions and 5 deletions

View File

@@ -586,7 +586,7 @@ if (!defined("DRIVER")) {
$alter = array();
foreach ($fields as $field) {
$alter[] = ($field[1]
? ($table != "" ? ($field[0] != "" ? "CHANGE " . idf_escape($field[0]) : "ADD") : " ") . " " . implode("", $field[1]) . ($table != "" ? " $field[2]" : "")
? ($table != "" ? ($field[0] != "" ? "CHANGE " . idf_escape($field[0]) : "ADD") : " ") . " " . implode($field[1]) . ($table != "" ? " $field[2]" : "")
: "DROP " . idf_escape($field[0])
);
}

View File

@@ -348,7 +348,7 @@ WHERE tc.constraint_type = 'FOREIGN KEY' AND tc.table_name = " . $connection->qu
$val[1] = ($val[1] == "bigint" ? " big" : " ") . "serial";
}
if ($field[0] == "") {
$alter[] = ($table != "" ? "ADD " : " ") . implode("", $val);
$alter[] = ($table != "" ? "ADD " : " ") . implode($val);
} else {
if ($column != $val[0]) {
$queries[] = "ALTER TABLE " . idf_escape($table) . " RENAME $column TO $val[0]";

View File

@@ -394,7 +394,7 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
$alter = array();
foreach ($fields as $field) {
if ($field[1]) {
$alter[] = ($table != "" && $field[0] == "" ? "ADD " : " ") . implode("", $field[1]);
$alter[] = ($table != "" && $field[0] == "" ? "ADD " : " ") . implode($field[1]);
}
}
$alter = array_merge($alter, $foreign);
@@ -524,7 +524,7 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
function trigger_sql($table, $style) {
global $connection;
return implode("", get_vals("SELECT sql || ';;\n' FROM sqlite_master WHERE type = 'trigger' AND name = " . $connection->quote($table)));
return implode(get_vals("SELECT sql || ';;\n' FROM sqlite_master WHERE type = 'trigger' AND name = " . $connection->quote($table)));
}
function show_variables() {