多重條件組合查詢(二)_PHP教程
Jul 21, 2016 pm 04:06 PM
接一來這部分是實現(xiàn)用戶提交之后的查詢結果,也是程序代碼的主體部份:??
??
$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."所有數(shù)據(jù)";??
break;??
case 2:??
switch($price)??
{??
case 1:??
$querystring.=" where no=".$no." or price$showstr.="訂單為".$no."或者價格少于50元的所有數(shù)據(jù)";??
break;??
case 2:??
$querystring.=" where no=".$no." or price between 50 and 200";??
$showstr.="訂單為".$no."或者價格介于50到200元間的所有數(shù)據(jù)";??
break;??
case 3:??
$querystring.=" where no=".$no." or price>200";??
$showstr.="訂單為".$no."或者價格大于200元間的所有數(shù)據(jù)";??
break;??
}??
break;??
case 3:??
switch($price)??
{??
case 1:??
$querystring.=" where no=".$no." and price$showstr.="訂單為".$no."并且價格少于50元的所有數(shù)據(jù)";??
break;??
case 2:??
$querystring.=" where no=".$no." and price between 50 and 200";??
$showstr.="訂單為".$no."并且價格介于50到200元間的所有數(shù)據(jù)";??
break;??
case 3:??
$querystring.=" where no=".$no." and price>200";??
$showstr.="訂單為".$no."并且價格大于200元間的所有數(shù)據(jù)";??
break;??
}??
break;??
}??
}??
else??
{??
if (!empty($type))??
{??
switch($select2)??
{??
case 1:??
$querystring.=" where type="".$type."" ";??
$showstr.=" 類型為".$type."所有數(shù)據(jù)";??
break;??
case 2:??
switch($price)??
{??
case 1:??
$querystring.=" where type="".$type."" or price$showstr.="類型為".$type."或者價格少于50元的所有數(shù)據(jù)";??
break;??
case 2:??
$querystring.=" where type="".$type."" or price between 50 and 200";??
$showstr.="類型為".$type."或者價格介于50到200元間的所有數(shù)據(jù)";??
break;??
case 3:??
$querystring.=" where type="".$type."" or price>200";??
$showstr.="類型為".$type."或者價格大于200元間的所有數(shù)據(jù)";??
break;??
}??
break;??
case 3:??
switch($price)??
{??
case 1:??
$querystring.=" where type="".$type."" and price$showstr.="類型為".$type."并且價格少于50元的所有數(shù)據(jù)";??
break;??
case 2:??
$querystring.=" where type="".$type."" and price between 50 and 200";??
$showstr.="類型為".$type."并且價格介于50到200元間的所有數(shù)據(jù)";??
break;??
case 3:??
$querystring.=" where type="".$type."" and price>200";??
$showstr.="類型為".$type."并且價格大于200元間的所有數(shù)據(jù)";??
break;??
}??
break;??
}??
}??
else??
{??
switch($price)??
{??
case 1:??
$querystring.=" where price$showstr.="價格少于50元的所有數(shù)據(jù)";??
break;??
case 2:??
$querystring.=" where price between 50 and 200";??
$showstr.="價格介于50到200元間的所有數(shù)據(jù)";??
break;??
case 3:??
$querystring.=" where price>200";??
$showstr.="價格大于200元間的所有數(shù)據(jù)";??
break;??
}??
}??
}??
break;??
case 2:??
switch($select2)??
{??
case 1:??
$querystring.=" where no=".$no." or type="".$type.""";??
$showstr.="訂單為".$no."或者類別為".$type."所有數(shù)據(jù)";??
break;??
case 2:??
switch($price)??
{??
case 1:??
$querystring.=" where no=".$no." or type="".$type."" or price$showstr.="訂單為".$no."或者類別為".$type."或者價格少于50元的所有數(shù)據(jù)";??
break;??
case 2:??
$querystring.=" where no=".$no." or type="".$type."" or price between 50 and 200";??
$showstr.="訂單為".$no."或者類別為".$type."或者價格介于50到200元間的所有數(shù)據(jù)";??
break;??
case 3:??
$querystring.=" where no=".$no."or type="".$type."" or price>200";??
$showstr.="訂單為".$no."或者類別為".$type."或者價格大于200元間的所有數(shù)據(jù)";??
break;??
}??
break;??
case 3:??
switch($price)??
{??
case 1:??
$querystring.=" where no=".$no." or type="".$type."" and price$showstr.="訂單為".$no."或者類別為".$type."并且價格少于50元的所有數(shù)據(jù)";??
break;??
case 2:??
$querystring.=" where no=".$no." or type="".$type."" and price between 50 and 200";??
$showstr.="訂單為".$no."或者類別為".$type."并且價格介于50到200元間的所有數(shù)據(jù)";??
break;??
case 3:??
$querystring.=" where no=".$no."or type="".$type."" and price>200";??
$showstr.="訂單為".$no."或者類別為".$type."并且價格大于200元間的所有數(shù)據(jù)";??
break;??
}??
break;??
}??
break;??
case 3:??
switch($select2)??
{??
case 1:??
$querystring.=" where no=".$no." and type="".$type.""";??
$showstr.="訂單為".$no."并且類別為".$type."所有數(shù)據(jù)";??
break;??
case 2:??
switch($price)??
{??
case 1:??
$querystring.=" where no=".$no." and type="".$type."" or price$showstr.="訂單為".$no."并且類別為".$type."或者價格少于50元的所有數(shù)據(jù)";??
break;??
case 2:??
$querystring.=" where no=".$no." and type="".$type."" or price between 50 and 200";??
$showstr.="訂單為".$no."并且類別為".$type."或者價格介于50到200元間的所有數(shù)據(jù)";??
break;??
case 3:??
$querystring.=" where no=".$no."and type="".$type."" or price>200";??
$showstr.="訂單為".$no."并且類別為".$type."或者價格大于200元間的所有數(shù)據(jù)";??
break;??
}??
break;??
case 3:??
switch($price)??
{??
case 1:??
$querystring.=" where no=".$no." and type="".$type."" and price$showstr.="訂單為".$no."并且類別為".$type."并且價格少于50元的所有數(shù)據(jù)";??
break;??
case 2:??
$querystring.=" where no=".$no." and type="".$type."" and price between 50 and 200";??
$showstr.="訂單為".$no."并且類別為".$type."并且價格介于50到200元間的所有數(shù)據(jù)";??
break;??
case 3:??
$querystring.=" where no=".$no."and type="".$type."" and price>200";??
$showstr.="訂單為".$no."并且類別為".$type."并且價格大于200元間的所有數(shù)據(jù)";??
break;??
}??
break;??
}??
break;??
}??
$result=mysql_query($querystring,$linkstr);??
echo "
$showstr:
??
";??
if (@mysql_num_rows($result)>0)??
{??
while (list($no,$type,$name,$qty,$price)=mysql_fetch_row($result))??
{??
echo "
訂單編號 | ";??$no | ";??
類別 | ";??$type | ";??
配件 | ";??$name | ";??
數(shù)量 | ";??$qty | ";??
價格 | ";??$price | ";??
}??
}??
?>??

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

iPhone? ?? ??? Apple? ?? ?? ?? ????? ?????. ??? ?? ???? ??? ?? ??? ????? ? ???? ????. Google ??? ???? ???? ??? ? ????. ? ????? Google ??? ???? iPhone? ?? ??? ??? ?? ??? ??? ?? ?????. iPhone?? Google ??? ?? ??? ???? ?? Google ??? ????? ?? ?? ??? ???? ?? ???? ????. ?? ??? ?????. – ?? ?? ?? – ???? Gmail? ???? ??? ???. 1?? – AppStore? ???. 2?? – “Gmail”? ?????. 3?? - Gmail ? ?? ?????.

Gigabyte ?????? ??? ??? ???? ?? ??, ??? ??? ???? ??? PS2 ????? ???! ! ?? ??? ??? ????. 1??: ?? ? Del ?? F2? ?? BIOS? ????, BIOS? ??(Advanced) ??? ?????. ?? ????? ????? ????? EZ(Easy) ??? ?????. F7? ?? ?? ??? ?????. ROG ??? ????? ????? BIOS? ?????. ?? ??(?? ???? ???? ??) 2??: - [??] - [?? ?? ??(APM)]? ?????. [PS2 ???? ???] ?? ?? 4??: ? ?? ???? ???????. ??? ??? ? ?? ?? ?? ??? ?????. ?, ???? ??? [?????]? ??? ??? ????.

C++? ????? ????? ???? ? ?? ???? ???? ????? ??? ?? ?????. ????? ????? ?? ??? ?? ?? ? ????? ??? ??? ? ?? ???? ?????????. ? ????? C++? ???? ??? ????? ????? ???? ??? ?????. ????? ???? ??? ??? ???? ???? ??? ??? ???? ????. C++??? time.h ?? ??? ??? ???? ??? ??? ??? ? ????. ??? ??? ????? ????? ?????.

?? ?? ??? ?? ????? ?? ??????? ?? ?? ?? ???? ?? ???? ???? ??? ???? ?? ????? ????? ? ?? ??? ???? ? ? ????. ???? ????? ???? ??? ?? ?? ???? ?? ????? ?? ???? ??? ?? ?? ?? ????? ??? ????. ????? ??? ?? ????? ??? ?????? ?? ??? ?? ??? ?? ????? ??? ?? ??? ?????. Windows ??? ?????? ?? ?? ?? ??? ?????. ?? ??? ??? ????? ??? ???? ??? ?????. ?? ?? ????? ?? ??? ???? ??? ?????. ???? ??? ??? ???? ??? ?????. ??? ??

???? ?? ?? ???? ??? ??? iPhone? ?? ???? ?? ?????. ??? ?? ?? ??? ?? ??, ????, ?? ?? ? ?? ?? ??? ??? ? ????. ??? ??? ?? ?? ???? ?? ?? ? ? ??? ? ?? ??? ???. ??? ???? ? ??? ???? ? ??? ? ? ????. ?? 1 - ?? ? ?? ??? ? ???? ?? ?? ??? ?? ?? ?? ?? ???? ??? ? ????. 1?? – iPhone? ?? ???? ? ????? ???? ??? ??? ???? ???????. 2?? – ???? ???? “??”? ?????. 3?? – ?? ?? ??? “??”? ???? ?? ???

????????(Glodon Software)? ????? ??? ???? ????? ???, ?? ??? ?? ??, ??, ?? ??? ?? ??? ???? ??. Glodon ?????? ??? ??? ??? ???? ?? ?? ??? ??? ?????. ? ????? ??? ??? ??? ?? ????? ??? ? ??? Glodon ?????? ??? ?? ?? ??? ?? ???? ??? ?????. Glodon ?????? ???? ??, ????? ? ?? ??? ??? ? ?? ?? ??? ?? ? ??? ?????. ????? ?? ? ????. Intel i7 ??? ?? AMD Ryzen ???? ?? ?? ??, ??? ????? ???? ?? ????. ??? ????? ??? ??? ??? ?? ??? ?? ??? ??? ?? Glodon ?????? ?? ??? ? ? ??? ? ????. ??? ???? ???? ??? ??? ????.

?? ????? ? ? "??? ? ???? ?? ??? ??? ? ????"?? ???? ?????? ????? ??? ?? ?? ???? ??? ? ??? ??? ?????. ?, ??? ??? ?? ???? ???? ???? ??? ?? ?? ?? ???? ?????. ? ??? ???? ?? ?? ????? 1~2? ?? ??? ? ????. ?? 1 – ???, ??? ?? ?? ???? ?? ??? ??? ? ??? ??? ??? ? ????. 1?? - ?? ??? ?????. 2?? – ?? ?? ?? ? ?? ??? ???. 3?? - ???? "???" ??? ???. 4?? - ???? ??? ???? ?? ??? ??? ? ??? ?? ? ????. 5?? - ??? ?? "???"? ???.

1. ???? ??? ??? ??? ? ????? ?? ??? ?? ?? ? ?????. CS? ?? ??? ???? ? ????? ??? ??? ????? ?? ??? ???? ??? ????. Intel Core i5 ?? i7 ??? ????? ??? ?? ?? ?? ??? ?? ???? ??? CS? ?? ?? ??? ?? ??? ? ???? ???? ?? ????. 2. ??? ?? ??? ??? ?? ??? ???? ??? ?? ? ?????. CS ? ?? ????? ??? ??? ??? ?? ??? ???? ????? ???? ??? ????. NVIDIA GeForce GTX ??? ?? AMD Radeon RX ??? ??? ??? ???? ?? ????. ? ??? ??? ??? ?? ??? ?? ??? ?? ??? ??? ??? ? ?? ?? ??? ??? ? ????.
