PHP如何编写在文本框输入值,勾选复选框,根据复选框选中的值去查询数据库的数据并显示出来?
<formaction=""method="post"style="text-align:center"name="ipform"onsubmit="returnchec...
<form action="" method="post" style="text-align:center" name="ipform" onsubmit="return checkIP();"> </br> 请输入一个值: <input type="text" name="NUMBER" > <input type="checkbox" name="checkbox[]" value="IPROD"> 物料编号 <input type="checkbox" name="checkbox[]" value="IDESC"> 描述 <input type="checkbox" name="checkbox[]" value="VENDOR"> 供应商 <input type="checkbox" name="checkbox[]" value="VNDNAM"> 供应商名称 <input type="submit" class="sm" value="提交查询内容" > </form></br><?phpinclude("comm\bpcs.php");$NUMBER=$_POST["NUMBER"];if (!empty($_POST['NUMBER'])) {$sql="select IPROD,IDESC from BPCSF62/IIML01 where IPROD LIKE upper('%".$NUMBER."%') OR IDESC LIKE upper('%".$NUMBER."%') ";$result=odbc_exec($conn_CUS,$sql); echo "<table align='center'> <tr> <th width='300'>物料编号</th> <th width='500'>描述</th> <th>查询PO</th> </tr>"; while ($row=odbc_fetch_array($result)) { echo "<tr class='alt'>"; echo "<td>".$row['IPROD']."</td>"; echo "<td>".$row['IDESC']."</td>"; $sql="SELECT COUNT(*) as TOTAL FROM BPCSF62/HPOL01 WHERE PPROD = '".$row['IPROD']."' AND PQORD> PQREC "; $result1=odbc_exec($conn_CUS,$sql); while($temp=odbc_fetch_array($result1)){ if ($temp['TOTAL']>0){ echo "<td><a href=PUR_po_display.php?PPROD=".$row['IPROD']."&FROMDATE=0&TODATE=0&PO=0&POLINE=0 target='_blank' style='text-decoration:none;'>查询PO</a></td>"; } else{ echo '<td> </td>'; echo "</tr>"; } } } echo "</table>";
展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询