<html>
<?
$linkstr=mysql_connect("localhost","root","sa");
mysql_select_db("cx",$linkstr);
?>
<script language="JavaScript">
function variable()
{
if (document.search.select1.value!="1")
{
if (document.search.no.value=="")
{
window.alert("請輸入訂單號碼!");
return false;
}
else
{
if (document.search.type.value=="")
{
window.alert("請選擇配件類別!");
return false;
}
}
}
else
{
if (document.search.select2.value!="1")
{
if (document.search.price.value=="")
{
window.alert("請輸入價格!");
return false;
}
}
}
}
</script>
<br>
<center><font size="5"><b>多重條件組合查詢</b></font></center>
<br>
<body>
<form action="searchjg.php" method="POST" name="search" onsubmit="return variable(this.value)">
<table align="center" border="1" width="400">
<tr>
<td align="left" width="100">訂單編號</td>
<td align="left" width="300"><input type="text" name="no"></td>
</tr>
<tr>
<td align="left" width="200">
<select name="select1">
<option selected value="1">
<option value="2">或者
<option value="3">而且
</select>類別為
</td>
<td align="left" width="200">
<select name="type">
<option selected>
<?
$querystring="select distinct type from orders ";
$result=mysql_query($querystring,$linkstr);
while (list($type)=mysql_fetch_row($result))
{
echo "<option value="$type">".$type;
}
?>
</select>
</tr>
<tr>
<td>
<select name="select2">
<option selected value="1">
<option value="2">或者
<option value="3">而且
</select>價格位在
</td>
<td><select name="price">
<option selected>
<option value="1">50以下
<option value="2">50~200?
<option value="3">200以上
</select>的配件
</td>
</tr>
<table width="400" align="right">
<tr>
<td>
<input type="submit" name="submit" value="開始查詢">
</td>
</tr>
</table>
</table>
</form>
</body>
</html>
聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com