]> git.joonet.de Git - adminer.git/commitdiff
Save bytes
authorJakub Vrana <jakub@vrana.cz>
Sat, 27 Apr 2013 05:11:58 +0000 (22:11 -0700)
committerJakub Vrana <jakub@vrana.cz>
Sat, 27 Apr 2013 05:22:38 +0000 (22:22 -0700)
adminer/include/adminer.inc.php
adminer/select.inc.php

index db1b88dc63843de578802907f88546302041f31b..615d92ccf76d390bb3b63bfcc3a2107d5bb7ff00 100644 (file)
@@ -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
index 6bc33198db1fc802e4b047161be2c5aa8a5b1712..a249bc2d6a804b266f7cdee0f3c1ea0ea45a40c7 100644 (file)
@@ -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;
 }