<?php 
include_once("conn.php");

$sql="select ddnumber,commodity from tb_commodity_order_form where ddnumber='".$_POST[ddnumber]."'";
$result=mysql_query($sql);
$myrow=mysql_fetch_array($result);
$array=explode(",",$myrow[commodity]);

?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>订单查询</title>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.STYLE1 {
	color: #FF0000;
	font-weight: bold;
}
-->
</style></head>

<body>
<table width="1003" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><div align="center"><img src="images/sy_2.jpg" width="1003" height="75"></div></td>
  </tr>
</table>
<table width="1003" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center"><img src="images/sy_4.jpg" width="825" height="140"></td>
  </tr>
</table>
<table width="1003" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="89">&nbsp;</td>
    <td width="825"><table width="825" border="1" align="center" cellpadding="1" cellspacing="1" bordercolor="#FFFFFF" bgcolor="#D0D0D0">
<tr>
<td align="center" bgcolor="#FFFFFF"><img src="images/sy_8.jpg" width="781" height="25">
 

<table width="585" height="53" border="0" cellpadding="0" cellspacing="0">
<form name="form1" method="post" action="select_ddnumber.php">
  <tr>
    <td width="176" align="right"><span class="STYLE1">请输入订单号：</span></td>
    <td width="186"><input type="text" name="ddnumber"></td>
    <td width="223"><input type="submit" name="Submit" value="提交"></td>
  </tr>
</form>
</table>
<table width="589" height="106" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center">商品名</td>
    <td align="center">单价</td>
    <td align="center">数量</td>
    <td align="center">金额</td>
    <td align="center">订单号</td>
 
<?php 
for($i=0;$i<count($array);$i++){   //获取数组中元素的个数
if(($i%5)==0){						//判断每行输出5个元素值
?>
 </tr>
<tr>  
<?php }?>
    <td align="center"><?php echo $array[$i];?></td>
<?php 
if(($i%5)!=0){					//当元素值超过5个时，跳转到下一行
}
}?>  

</table>
</td>
</tr>
</table></td>
    <td width="89">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="3"><img src="images/sy_21.jpg" width="1003" height="45"></td>
  </tr>
</table>
</body>
</html>
