六月婷婷综合激情-六月婷婷综合-六月婷婷在线观看-六月婷婷在线-亚洲黄色在线网站-亚洲黄色在线观看网站

明輝手游網中心:是一個免費提供流行視頻軟件教程、在線學習分享的學習平臺!

多重條件組合查詢(二)

[摘要]接一來這部分是實現用戶提交之后的查詢結果,也是程序代碼的主體部份: <? linkstr=mysql_connect("localhost","root","sa"); mysql_select_db("cx&quo...
接一來這部分是實現用戶提交之后的查詢結果,也是程序代碼的主體部份:  
<?  
$linkstr=mysql_connect("localhost","root","sa");  
mysql_select_db("cx",$linkstr);  
$showstr="查詢條件為:";  
$querystring="select no,type,name,qty,price from orders";  
switch($select1)  
{  
case 1:  
if (!empty($no))  
{  
switch($select2)  
{  
case 1:  
$querystring.=" where no=".$no;  
$showstr.="訂單為".$no."所有數據";  
break;  
case 2:  
switch($price)  
{  
case 1:  
$querystring.=" where no=".$no." or price<50";  
$showstr.="訂單為".$no."或者價格少于50元的所有數據";  
break;  
case 2:  
$querystring.=" where no=".$no." or price between 50 and 200";  
$showstr.="訂單為".$no."或者價格介于50到200元間的所有數據";  
break;  
case 3:  
$querystring.=" where no=".$no." or price>200";  
$showstr.="訂單為".$no."或者價格大于200元間的所有數據";  
break;  
}  
break;  
case 3:  
switch($price)  
{  
case 1:  
$querystring.=" where no=".$no." and price<50";  
$showstr.="訂單為".$no."并且價格少于50元的所有數據";  
break;  
case 2:  
$querystring.=" where no=".$no." and price between 50 and 200";  
$showstr.="訂單為".$no."并且價格介于50到200元間的所有數據";  
break;  
case 3:  
$querystring.=" where no=".$no." and price>200";  
$showstr.="訂單為".$no."并且價格大于200元間的所有數據";  
break;  
}  
break;  
}  
}  
else  
{  
if (!empty($type))  
{  
switch($select2)  
{  
case 1:  
$querystring.=" where type="".$type."" ";  
$showstr.=" 類型為".$type."所有數據";  
break;  
case 2:  
switch($price)  
{  
case 1:  
$querystring.=" where type="".$type."" or price<50";  
$showstr.="類型為".$type."或者價格少于50元的所有數據";  
break;  
case 2:  
$querystring.=" where type="".$type."" or price between 50 and 200";  
$showstr.="類型為".$type."或者價格介于50到200元間的所有數據";  
break;  
case 3:  
$querystring.=" where type="".$type."" or price>200";  
$showstr.="類型為".$type."或者價格大于200元間的所有數據";  
break;  
}  
break;  
case 3:  
switch($price)  
{  
case 1:  
$querystring.=" where type="".$type."" and price<50";  
$showstr.="類型為".$type."并且價格少于50元的所有數據";  
break;  
case 2:  
$querystring.=" where type="".$type."" and price between 50 and 200";  
$showstr.="類型為".$type."并且價格介于50到200元間的所有數據";  
break;  
case 3:  
$querystring.=" where type="".$type."" and price>200";  
$showstr.="類型為".$type."并且價格大于200元間的所有數據";  
break;  
}  
break;  
}  
}  
else  
{  
switch($price)  
{  
case 1:  
$querystring.=" where price<50";  
$showstr.="價格少于50元的所有數據";  
break;  
case 2:  
$querystring.=" where price between 50 and 200";  
$showstr.="價格介于50到200元間的所有數據";  
break;  
case 3:  
$querystring.=" where price>200";  
$showstr.="價格大于200元間的所有數據";  
break;  
}  
}  
}  
break;  
case 2:  
switch($select2)  
{  
case 1:  
$querystring.=" where no=".$no." or type="".$type.""";  
$showstr.="訂單為".$no."或者類別為".$type."所有數據";  
break;  
case 2:  
switch($price)  
{  
case 1:  
$querystring.=" where no=".$no." or type="".$type."" or price<50 ";  
$showstr.="訂單為".$no."或者類別為".$type."或者價格少于50元的所有數據";  
break;  
case 2:  
$querystring.=" where no=".$no." or type="".$type."" or price between 50 and 200";  
$showstr.="訂單為".$no."或者類別為".$type."或者價格介于50到200元間的所有數據";  
break;  
case 3:  
$querystring.=" where no=".$no."or type="".$type."" or price>200";  
$showstr.="訂單為".$no."或者類別為".$type."或者價格大于200元間的所有數據";  
break;  
}  
break;  
case 3:  
switch($price)  
{  
case 1:  
$querystring.=" where no=".$no." or type="".$type."" and price<50 ";  
$showstr.="訂單為".$no."或者類別為".$type."并且價格少于50元的所有數據";  
break;  
case 2:  
$querystring.=" where no=".$no." or type="".$type."" and price between 50 and 200";  
$showstr.="訂單為".$no."或者類別為".$type."并且價格介于50到200元間的所有數據";  
break;  
case 3:  
$querystring.=" where no=".$no."or type="".$type."" and price>200";  
$showstr.="訂單為".$no."或者類別為".$type."并且價格大于200元間的所有數據";  
break;  
}  
break;  
}  
break;  
case 3:  
switch($select2)  
{  
case 1:  
$querystring.=" where no=".$no." and type="".$type.""";  
$showstr.="訂單為".$no."并且類別為".$type."所有數據";  
break;  
case 2:  
switch($price)  
{  
case 1:  
$querystring.=" where no=".$no." and type="".$type."" or price<50 ";  
$showstr.="訂單為".$no."并且類別為".$type."或者價格少于50元的所有數據";  
break;  
case 2:  
$querystring.=" where no=".$no." and type="".$type."" or price between 50 and 200";  
$showstr.="訂單為".$no."并且類別為".$type."或者價格介于50到200元間的所有數據";  
break;  
case 3:  
$querystring.=" where no=".$no."and type="".$type."" or price>200";  
$showstr.="訂單為".$no."并且類別為".$type."或者價格大于200元間的所有數據";  
break;  
}  
break;  
case 3:  
switch($price)  
{  
case 1:  
$querystring.=" where no=".$no." and type="".$type."" and price<50 ";  
$showstr.="訂單為".$no."并且類別為".$type."并且價格少于50元的所有數據";  
break;  
case 2:  
$querystring.=" where no=".$no." and type="".$type."" and price between 50 and 200";  
$showstr.="訂單為".$no."并且類別為".$type."并且價格介于50到200元間的所有數據";  
break;  
case 3:  
$querystring.=" where no=".$no."and type="".$type."" and price>200";  
$showstr.="訂單為".$no."并且類別為".$type."并且價格大于200元間的所有數據";  
break;  
}  
break;  
}  
break;  
}  
$result=mysql_query($querystring,$linkstr);  
echo "<p>$showstr:<p>  
";  
if (@mysql_num_rows($result)>0)  
{  
while (list($no,$type,$name,$qty,$price)=mysql_fetch_row($result))  
{  
echo "<table align="center">";  
echo "<tr>";  
echo "<td>訂單編號</td>";  
echo "<td>$no</td>";  
echo "</tr>";  
echo "<tr>";  
echo "<td>類別</td>";  
echo "<td>$type</td>";  
echo "</tr>";  
echo "<tr>";  
echo "<td>配件</td>";  
echo "<td>$name</td>";  
echo "</tr>";  
echo "<tr>";  
echo "<td>數量</td>";  
echo "<td>$qty</td>";  
echo "</tr>";  
echo "<tr>";  
echo "<td>價格</td>";  
echo "<td>$price</td>";  
echo "</tr>";  
echo "</table>";  
}  
}  
?>  



主站蜘蛛池模板: 日日夜夜拍 | 欧美无人区码卡二卡3卡4免费 | 亚洲成人aaa | 欧美怡红院免费全部视频 | 亚洲黄色网址大全 | 亚洲自拍中文 | 日韩精品欧美一区二区三区 | 亚洲人成绝费网站色ww | 日韩国产在线播放 | 日韩一级片免费在线观看 | 亚洲六月丁香色婷婷综合久久 | 亚洲第一黄色网址 | 日产精品一区二区 | 色迷迷网免费站视频在线观看 | 日韩福利视频一区 | 热久久伊人 | 亚洲第一网站在线观看 | 日韩三级在线 | 亚洲 日本 欧美 日韩精品 | 亚洲精品日韩专区在线观看 | 一级做a爰片久久毛片看看 一级做a爰片久久毛片16 | 欧美一卡二卡三卡四卡 | 五月婷婷丁香 | 在线观看精品视频一区二区 | 欧美视频一二三区 | 色橹橹欧美在线观看高清视频 | 亚洲国产观看 | 亚洲专区欧美 | 亚洲图片欧美在线 | 日韩中文精品亚洲第三区 | 桃色视频网 | 亚洲欧美另类综合 | 青青草华人在线 | 一级做a爰片性色毛片视频图片 | 天天躁夜夜躁很很躁麻豆 | 青青青手机视频 | 五月天丁香婷婷综合 | 天堂伦理 | 亚洲福利午夜 | 图片一区 | 亚洲 欧美 中文 日韩专区 |