接一?磉@部分是???用?籼峤恢?蟮牟樵??果,也是程序代?的主体部份:
<?
$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.="????quot;.$no."所有?稻?quot;;
break;
case 2:
switch($price)
{
case 1:
$querystring.=" where no=".$no." or price<50";
$showstr.="????quot;.$no."或者价格少于50元的所有?稻?quot;;
break;
case 2:
$querystring.=" where no=".$no." or price between 50 and 200";
$showstr.="????quot;.$no."或者价格介于50到200元?的所有?稻?quot;;
break;
case 3:
$querystring.=" where no=".$no." or price>200";
$showstr.="????quot;.$no."或者价格大于200元?的所有?稻?quot;;
break;
}
break;
case 3:
switch($price)
{
case 1:
$querystring.=" where no=".$no." and price<50";
$showstr.="????quot;.$no."并且价格少于50元的所有?稻?quot;;
break;
case 2:
$querystring.=" where no=".$no." and price between 50 and 200";
$showstr.="????quot;.$no."并且价格介于50到200元?的所有?稻?quot;;
break;
case 3:
$querystring.=" where no=".$no." and price>200";
$showstr.="????quot;.$no."并且价格大于200元?的所有?稻?quot;;
break;
}
break;
}
}
else
{
if (!empty($type))
{
switch($select2)
{
case 1:
$querystring.=" where type="".$type."" ";
$showstr.=" ?型??quot;.$type."所有?稻?quot;;
break;
case 2:
switch($price)
{
case 1:
$querystring.=" where type="".$type."" or price<50";
$showstr.="?型??quot;.$type."或者价格少于50元的所有?稻?quot;;
break;
case 2:
$querystring.=" where type="".$type."" or price between 50 and 200";
$showstr.="?型??quot;.$type."或者价格介于50到200元?的所有?稻?quot;;
break;
case 3:
$querystring.=" where type="".$type."" or price>200";
$showstr.="?型??quot;.$type."或者价格大于200元?的所有?稻?quot;;
break;
}
break;
case 3:
switch($price)
{
case 1:
$querystring.=" where type="".$type."" and price<50";
$showstr.="?型??quot;.$type."并且价格少于50元的所有?稻?quot;;
break;
case 2:
$querystring.=" where type="".$type."" and price between 50 and 200";
$showstr.="?型??quot;.$type."并且价格介于50到200元?的所有?稻?quot;;
break;
case 3:
$querystring.=" where type="".$type."" and price>200";
$showstr.="?型??quot;.$type."并且价格大于200元?的所有?稻?quot;;
break;
}
break;
}
}
else
{
switch($price)
{
case 1:
$querystring.=" where price<50";
$showstr.="价格少于50元的所有?稻?quot;;
break;
case 2:
$querystring.=" where price between 50 and 200";
$showstr.="价格介于50到200元?的所有?稻?quot;;
break;
case 3:
$querystring.=" where price>200";
$showstr.="价格大于200元?的所有?稻?quot;;
break;
}
}
}
break;
case 2:
switch($select2)
{
case 1:
$querystring.=" where no=".$no." or type="".$type.""";
$showstr.="????quot;.$no."或者??e??quot;.$type."所有?稻?quot;;
break;
case 2:
switch($price)
{
case 1:
$querystring.=" where no=".$no." or type="".$type."" or price<50 ";
$showstr.="????quot;.$no."或者??e??quot;.$type."或者价格少于50元的所有?稻?quot;;
break;
case 2:
$querystring.=" where no=".$no." or type="".$type."" or price between 50 and 200";
$showstr.="????quot;.$no."或者??e??quot;.$type."或者价格介于50到200元?的所有?稻?quot;;
break;
case 3:
$querystring.=" where no=".$no."or type="".$type."" or price>200";
$showstr.="????quot;.$no."或者??e??quot;.$type."或者价格大于200元?的所有?稻?quot;;
break;
}
break;
case 3:
switch($price)
{
case 1:
$querystring.=" where no=".$no." or type="".$type."" and price<50 ";
$showstr.="????quot;.$no."或者??e??quot;.$type."并且价格少于50元的所有?稻?quot;;
break;
case 2:
$querystring.=" where no=".$no." or type="".$type."" and price between 50 and 200";
$showstr.="????quot;.$no."或者??e??quot;.$type."并且价格介于50到200元?的所有?稻?quot;;
break;
case 3:
$querystring.=" where no=".$no."or type="".$type."" and price>200";
$showstr.="????quot;.$no."或者??e??quot;.$type."并且价格大于200元?的所有?稻?quot;;
break;
}
break;
}
break;
case 3:
switch($select2)
{
case 1:
$querystring.=" where no=".$no." and type="".$type.""";
$showstr.="????quot;.$no."并且??e??quot;.$type."所有?稻?quot;;
break;
case 2:
switch($price)
{
case 1:
$querystring.=" where no=".$no." and type="".$type."" or price<50 ";
$showstr.="????quot;.$no."并且??e??quot;.$type."或者价格少于50元的所有?稻?quot;;
break;
case 2:
$querystring.=" where no=".$no." and type="".$type."" or price between 50 and 200";
$showstr.="????quot;.$no."并且??e??quot;.$type."或者价格介于50到200元?的所有?稻?quot;;
break;
case 3:
$querystring.=" where no=".$no."and type="".$type."" or price>200";
$showstr.="????quot;.$no."并且??e??quot;.$type."或者价格大于200元?的所有?稻?quot;;
break;
}
break;
case 3:
switch($price)
{
case 1:
$querystring.=" where no=".$no." and type="".$type."" and price<50 ";
$showstr.="????quot;.$no."并且??e??quot;.$type."并且价格少于50元的所有?稻?quot;;
break;
case 2:
$querystring.=" where no=".$no." and type="".$type."" and price between 50 and 200";
$showstr.="????quot;.$no."并且??e??quot;.$type."并且价格介于50到200元?的所有?稻?quot;;
break;
case 3:
$querystring.=" where no=".$no."and type="".$type."" and price>200";
$showstr.="????quot;.$no."并且??e??quot;.$type."并且价格大于200元?的所有?稻?quot;;
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>?盗?lt;/td>";
echo "<td>$qty</td>";
echo "</tr>";
echo "<tr>";
echo "<td>价格</td>";
echo "<td>$price</td>";
echo "</tr>";
echo "</table>";
}
}
?>
多重?l件?合查?(二)
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@