From 2afd915f006d8fdfe7ca8aa5666a2048483bdd71 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Fri, 26 Apr 2013 22:11:58 -0700 Subject: [PATCH] Save bytes --- adminer/include/adminer.inc.php | 6 +++--- adminer/select.inc.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index db1b88dc..615d92cc 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -626,10 +626,10 @@ username.form['auth[driver]'].onchange(); global $connection, $jush; $max_packet = ($jush == "sqlite" ? 0 : 1048576); // default, minimum is 1024 if ($style) { - if ($_POST["format"] == "sql" && $style == "TRUNCATE+INSERT") { - echo truncate_sql($table) . ";\n"; - } if ($_POST["format"] == "sql") { + if ($style == "TRUNCATE+INSERT") { + echo truncate_sql($table) . ";\n"; + } $fields = fields($table); } $result = $connection->query($query, 1); // 1 - MYSQLI_USE_RESULT //! enum and set as numbers diff --git a/adminer/select.inc.php b/adminer/select.inc.php index 6bc33198..a249bc2d 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -49,7 +49,7 @@ if ($_GET["val"] && is_ajax()) { header("Content-Type: text/plain; charset=utf-8"); foreach ($_GET["val"] as $unique_idf => $row) { $as = convert_field($fields[key($row)]); - echo $connection->result("SELECT" . limit(($as ? $as : idf_escape(key($row))) . " FROM " . table($TABLE), " WHERE " . where_check($unique_idf, $fields) . ($where ? " AND " . implode(" AND ", $where) : "") . ($order ? " ORDER BY " . implode(", ", $order) : ""), 1)); + echo $connection->result("SELECT" . limit($as ? $as : idf_escape(key($row)) . " FROM " . table($TABLE), " WHERE " . where_check($unique_idf, $fields) . ($where ? " AND " . implode(" AND ", $where) : "") . ($order ? " ORDER BY " . implode(", ", $order) : ""), 1)); } exit; }