此回复为自动发出,仅用于显示而已,并无任何其他特殊作用
楼主【liangling221】截止到2008-06-27 09:45:32的历史汇总数据(不包括此帖):
发帖数:50                 发帖分:1070               
结贴数:15                 结贴分:300                
未结数:35                 未结分:770                
结贴率:30.00 %            结分率:28.04 %            
楼主该结一些帖子了

解决方案 »

  1.   

    if($j%5 == 0) echo "</tr><tr>";
    这样看看。
      

  2.   

    不知道你所谓的外层循环是干什么用的,不过如果只是判断换行,内层的循环足够了,改了一下你试一下。  $i = 0;
    while($i < $rows){ //外面的while 循环
    ?>
    <div class="line"  id="product">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <?
    $list = tep_db_query($sql);
    $j = 0;
    while($list_set = tep_db_fetch_array($list)) { //从数据库里面读取数据然后显示到表格里面(内循环)
    $sptp = $list_set['sptp'];
    $lpmc = $list_set['lpmc'];
    ?>
    <td align="center">
    <div class="pbox">
    <a href="#"><img src=" <?=$sptp?>" alt="" width="96" height="97" border="0" class="img"></a>
    <p class="name"><a href="#"><?=$lpmc?></a></p>
    <p class="padbottom"> <strong class="jg">25 </strong>积分+ <strong>100元 </strong> </p>
    <a href="#"><img src="images/btn_sc.gif" width="55" height="22" border="0"></a>
    </div>
    </td>
    <?
    $j ++;
    if(($j - 1) != 0 && ($i - 1) % 5 == 0) {
    echo '</tr><tr>';
    }
    }?>
    </tr>
    </table>
    </div>
    <div class="line" id="product"></div>
    <?
    $i ++;
    }