多重l件M合查(二)
接一磉@部分是F用籼峤恢蟮牟樵Y果,也是程序代a的主体部份:
<?
$linkstr=mysql_connect("localhost","root","sa");
mysql_select_db("cx",$linkstr);
$showstr="查l件:";
$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元g的所有稻";
break;
case 3:
$querystring.=" where no=".$no." or price>200";
$showstr.="".$no."或者价格大于200元g的所有稻";
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元g的所有稻";
break;
case 3:
$querystring.=" where no=".$no." and price>200";
$showstr.="".$no."并且价格大于200元g的所有稻";
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元g的所有稻";
break;
case 3:
$querystring.=" where type="".$type."" or price>200";
$showstr.="型".$type."或者价格大于200元g的所有稻";
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元g的所有稻";
break;
case 3:
$querystring.=" where type="".$type."" and price>200";
$showstr.="型".$type."并且价格大于200元g的所有稻";
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元g的所有稻";
break;
case 3:
$querystring.=" where price>200";
$showstr.="价格大于200元g的所有稻";
break;
}
}
}
break;
case 2:
switch($select2)
{
case 1:
$querystring.=" where no=".$no." or type="".$type.""";
$showstr.="".$no."或者e".$type."所有稻";
break;
case 2:
switch($price)
{
case 1:
$querystring.=" where no=".$no." or type="".$type."" or price<50 ";
$showstr.="".$no."或者e".$type."或者价格少于50元的所有稻";
break;
case 2:
$querystring.=" where no=".$no." or type="".$type."" or price between 50 and 200";
$showstr.="".$no."或者e".$type."或者价格介于50到200元g的所有稻";
break;
case 3:
$querystring.=" where no=".$no."or type="".$type."" or price>200";
$showstr.="".$no."或者e".$type."或者价格大于200元g的所有稻";
break;
}
break;
case 3:
switch($price)
{
case 1:
$querystring.=" where no=".$no." or type="".$type."" and price<50 ";
$showstr.="".$no."或者e".$type."并且价格少于50元的所有稻";
break;
case 2:
$querystring.=" where no=".$no." or type="".$type."" and price between 50 and 200";
$showstr.="".$no."或者e".$type."并且价格介于50到200元g的所有稻";
break;
case 3:
$querystring.=" where no=".$no."or type="".$type."" and price>200";
$showstr.="".$no."或者e".$type."并且价格大于200元g的所有稻";
break;
}
break;
}
break;
case 3:
switch($select2)
{
case 1:
$querystring.=" where no=".$no." and type="".$type.""";
$showstr.="".$no."并且e".$type."所有稻";
break;
case 2:
switch($price)
{
case 1:
$querystring.=" where no=".$no." and type="".$type."" or price<50 ";
$showstr.="".$no."并且e".$type."或者价格少于50元的所有稻";
break;
case 2:
$querystring.=" where no=".$no." and type="".$type."" or price between 50 and 200";
$showstr.="".$no."并且e".$type."或者价格介于50到200元g的所有稻";
break;
case 3:
$querystring.=" where no=".$no."and type="".$type."" or price>200";
$showstr.="".$no."并且e".$type."或者价格大于200元g的所有稻";
break;
}
break;
case 3:
switch($price)
{
case 1:
$querystring.=" where no=".$no." and type="".$type."" and price<50 ";
$showstr.="".$no."并且e".$type."并且价格少于50元的所有稻";
break;
case 2:
$querystring.=" where no=".$no." and type="".$type."" and price between 50 and 200";
$showstr.="".$no."并且e".$type."并且价格介于50到200元g的所有稻";
break;
case 3:
$querystring.=" where no=".$no."and type="".$type."" and price>200";
$showstr.="".$no."并且e".$type."并且价格大于200元g的所有稻";
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>e</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>";
}
}
?>
<?
$linkstr=mysql_connect("localhost","root","sa");
mysql_select_db("cx",$linkstr);
$showstr="查l件:";
$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元g的所有稻";
break;
case 3:
$querystring.=" where no=".$no." or price>200";
$showstr.="".$no."或者价格大于200元g的所有稻";
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元g的所有稻";
break;
case 3:
$querystring.=" where no=".$no." and price>200";
$showstr.="".$no."并且价格大于200元g的所有稻";
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元g的所有稻";
break;
case 3:
$querystring.=" where type="".$type."" or price>200";
$showstr.="型".$type."或者价格大于200元g的所有稻";
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元g的所有稻";
break;
case 3:
$querystring.=" where type="".$type."" and price>200";
$showstr.="型".$type."并且价格大于200元g的所有稻";
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元g的所有稻";
break;
case 3:
$querystring.=" where price>200";
$showstr.="价格大于200元g的所有稻";
break;
}
}
}
break;
case 2:
switch($select2)
{
case 1:
$querystring.=" where no=".$no." or type="".$type.""";
$showstr.="".$no."或者e".$type."所有稻";
break;
case 2:
switch($price)
{
case 1:
$querystring.=" where no=".$no." or type="".$type."" or price<50 ";
$showstr.="".$no."或者e".$type."或者价格少于50元的所有稻";
break;
case 2:
$querystring.=" where no=".$no." or type="".$type."" or price between 50 and 200";
$showstr.="".$no."或者e".$type."或者价格介于50到200元g的所有稻";
break;
case 3:
$querystring.=" where no=".$no."or type="".$type."" or price>200";
$showstr.="".$no."或者e".$type."或者价格大于200元g的所有稻";
break;
}
break;
case 3:
switch($price)
{
case 1:
$querystring.=" where no=".$no." or type="".$type."" and price<50 ";
$showstr.="".$no."或者e".$type."并且价格少于50元的所有稻";
break;
case 2:
$querystring.=" where no=".$no." or type="".$type."" and price between 50 and 200";
$showstr.="".$no."或者e".$type."并且价格介于50到200元g的所有稻";
break;
case 3:
$querystring.=" where no=".$no."or type="".$type."" and price>200";
$showstr.="".$no."或者e".$type."并且价格大于200元g的所有稻";
break;
}
break;
}
break;
case 3:
switch($select2)
{
case 1:
$querystring.=" where no=".$no." and type="".$type.""";
$showstr.="".$no."并且e".$type."所有稻";
break;
case 2:
switch($price)
{
case 1:
$querystring.=" where no=".$no." and type="".$type."" or price<50 ";
$showstr.="".$no."并且e".$type."或者价格少于50元的所有稻";
break;
case 2:
$querystring.=" where no=".$no." and type="".$type."" or price between 50 and 200";
$showstr.="".$no."并且e".$type."或者价格介于50到200元g的所有稻";
break;
case 3:
$querystring.=" where no=".$no."and type="".$type."" or price>200";
$showstr.="".$no."并且e".$type."或者价格大于200元g的所有稻";
break;
}
break;
case 3:
switch($price)
{
case 1:
$querystring.=" where no=".$no." and type="".$type."" and price<50 ";
$showstr.="".$no."并且e".$type."并且价格少于50元的所有稻";
break;
case 2:
$querystring.=" where no=".$no." and type="".$type."" and price between 50 and 200";
$showstr.="".$no."并且e".$type."并且价格介于50到200元g的所有稻";
break;
case 3:
$querystring.=" where no=".$no."and type="".$type."" and price>200";
$showstr.="".$no."并且e".$type."并且价格大于200元g的所有稻";
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>e</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>";
}
}
?>
相关推荐
Lincain 2019-06-27
82483564 2011-04-20
gcong 2019-06-13
88241243 2011-11-29
CommputerMac 2013-08-20
zhangwei0php 2019-04-16
JING 2012-05-24
Atptro 2012-09-06
BitTigerio 2018-03-05
松鼠的窝 2017-12-14
大故事家 2017-11-29
软件设计 2017-06-01
PHP编程开发 2016-10-27