]> git.joonet.de Git - adminer.git/commitdiff
Operator IN
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Wed, 25 Jul 2007 15:37:46 +0000 (15:37 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Wed, 25 Jul 2007 15:37:46 +0000 (15:37 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@250 7c3ca157-0c34-0410-bff1-cbf682f78f5c

select.inc.php

index 2cb3fba477da97a0533e20c1fe891f8b5694c62d..d3de582ba165b026f2e26b8e984837d386a20ff7 100644 (file)
@@ -39,11 +39,17 @@ if (!$columns) {
                        echo "<br />\n";
                }
        }
-       $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "REGEXP", "IS NULL");
+       $operators = array("=", "<", ">", "<=", ">=", "!=", "LIKE", "REGEXP", "IN", "IS NULL");
        $i = 0;
        foreach ((array) $_GET["where"] as $val) {
                if (strlen($val["col"]) && in_array($val["op"], $operators)) {
-                       $where[] = idf_escape($val["col"]) . " $val[op]" . ($val["op"] != "IS NULL" ? " '" . $mysql->escape_string($val["val"]) . "'" : "");
+                       if ($val["op"] == "IN") {
+                               $in = process_length($val["val"]);
+                               if (!strlen($in)) {
+                                       $in = "NULL";
+                               }
+                       }
+                       $where[] = idf_escape($val["col"]) . " $val[op]" . ($val["op"] == "IS NULL" ? "" : ($val["op"] == "IN" ? " ($in)" : " '" . $mysql->escape_string($val["val"]) . "'"));
                        echo "<div><select name='where[$i][col]'><option></option>" . optionlist($columns, $val["col"]) . "</select>";
                        echo "<select name='where[$i][op]' onchange=\"where_change(this);\">" . optionlist($operators, $val["op"]) . "</select>";
                        echo "<input name='where[$i][val]' value=\"" . htmlspecialchars($val["val"]) . "\" /></div>\n";