从HTML下拉选择中使用SQL'IN'运算符

时间:2019-01-16 22:58:58

标签: php html sql

我试图在HTML下拉选择中使用“ IN” SQL运算符,但在运行查询时它会返回任何内容。一次搜寻即可运作 北,东,西...等,但无法对ALL进行多重搜索。

HTML:

 <select name="region" type="text" id="region" style="font-family:Arial,Sans-Serif;width:180px;"/>
                    <option value="<?=$_GET["region"];?>"></option> 
                    <OPTION VALUE=('S','N','E','W','M','P','I')>ALL
                    <OPTION VALUE="N">North
                    <OPTION VALUE="E">East
                    <OPTION VALUE="S">South
                    <OPTION VALUE="W">West
                    <OPTION VALUE="M">Mapping
                    <OPTION VALUE="P">Photo
                   <OPTION VALUE="I">GIS                     
 </select>

PHP:

<?php 
    $db = "(DESCRIPTION=(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = **.56.**.**)(PORT = ****)))(CONNECT_DATA=(SID=XE)))";
    if($_GET["region"]!="")
    {  
    $objConnect = ocilogon("*****","******",$db);

    $strSQL = "SELECT * FROM SR4 WHERE AREA IN '".($_GET["region"])."';  

    $objParse = oci_parse ($objConnect, $strSQL); 

oci_execute($ objParse,OCI_DEFAULT);

?>

0 个答案:

没有答案