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

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

多重條件組合查詢(二)

[摘要]接一來這部分是實現用戶提交之后的查詢結果,也是程序代碼的主體部份: <? 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>";  
}  
}  
?>  



主站蜘蛛池模板: 欧美系列在线 | 伊人天天 | 婷婷色爱区综合五月激情韩国 | 日日摸夜夜摸狠狠摸日日碰夜夜做 | 日本尤物精品视频在线看 | 婷婷六月丁香色婷婷网 | 四虎在线最新永久免费播放 | 日本亚欧乱色视频在线系列 | 亚洲国产2017男人a天堂 | 在线观看中文字幕亚洲 | 亚洲国产成人久久综合一区 | 欧美性猛交xxxx乱大交 | 欧洲黄色大片 | 午夜性刺激免费视频观看不卡专区 | 午夜免费福利影院 | 色我网站| 日本大片免a费观看视频+播放器 | 日韩免费一区二区三区在线 | 青青草免费在线观看视频 | 日本a视频 | 青娱乐极品在线 | 色综合久久天天综合绕观看 | 午夜影院在线观看免费 | 亚洲天堂免费在线视频 | 色综合图区 | 香蕉视频在线观看免费国产婷婷 | 中文字幕不卡 | 中文字幕高清有码在线中字 | 素人啪啪 | 手机av在线播放 | 亚洲一区二区成人 | 羞羞色院91网站 | 青草资源视频在线高清观看 | 在线观看欧美日韩 | 亚洲视频三级 | 亚洲人成在线播放网站 | 天天摸日日摸人人看 | 欧洲性大片xxxxx久久久 | 午夜免费啪在线观看视频网站 | 日韩一级黄色 | 在线观看91精品国产下载 |