我想一个电子商城,图片怎么动态的循环啊?格式如下:
<TABLE cellSpacing=0 cellPadding=2 width=574 bgColor=#ffffff border=0>
        <TBODY>
        <TR>
          <TD class=yc vAlign=top align=middle width=140>
            <TABLE cellSpacing=0 cellPadding=1 width="90%" align=center border=0 
            valign="middle">
              <TBODY>
              <TR>
                <TD height="121" align=center vAlign=middle background="images/pic_bg2.gif" class=pic2><P class=pic1>&nbsp;</P></TD></TR>
              <TR>
                <TD>测试</TD>
              </TR>
              <TR>
                <TD>市场价:<B>800.00</B></TD></TR>
              <TR>
                <TD>热卖价:<B><FONT color=red>750.00</FONT></B></TD></TR>
              <TR>
                <TD>会员价:<B><FONT color=red>登陆更优惠</B></TD>
              </TR>
              <TR>
                <TD><IMG style="CURSOR: hand" 
                  onclick="window.open('order/shop.asp?ProdId=0018','blank_','scrollbars=yes,resizable=no,width=650,height=450')" 
                  alt=我要购买该商品 src="images/buy.gif" 
                  border=0><IMG style="CURSOR: hand" 
                  onclick="window.open('order/fav.asp?ProdId=0018','blank_','scrollbars=yes,resizable=no,width=650,height=450')" 
                  alt=收藏该商品 src="images/fav.gif" 
                  border=0></TD></TR></TBODY></TABLE></TD>
          <TD class=yc vAlign=top align=middle width=140>&nbsp;</TD>
          <TD class=yc vAlign=top align=middle width=140>&nbsp;</TD>
          <TD class=yc vAlign=top align=middle width=140>&nbsp;</TD>
        </TR></TBODY></TABLE>
希望高手帮忙!

解决方案 »

  1.   

    各位帮帮忙撒!我这样写格式不正确啊!
    <?php
    include_once("class/dbconn.class.php");
    $sql="select * from product";
    $class=new dbConn;
    $result=$class->connection($sql);
    for($i=0;$i<=$result["num"];$i++)
    {
    $arr[] = $i;
    }
    $sum=count($arr);
    $row = ceil($sum/4);
    $k=0;
    ?>
    <table width="100%"  border="0" cellspacing="0" cellpadding="0">
     <?php
     for ($i=1;$i<=$row;$i++)
    {
    echo "<tr>";
     while($k<count($arr))
    {
    $k++;
    echo "<td>".$arr[$k]."</td>";
    if($k%4==0)
    {break;}
    }
      echo "</tr>";
      }
      ?>
    </table>