给出一个循环,在循环体内部语句的功能是输出n个 后再输出标题,
即第一条标题前输出一个 第二条标题前输出两个 依此类推.

解决方案 »

  1.   

    我的程序是这样写的,能帮我改一下吗?
      <?
      $result=@mysql_query("select * from re where re_pic1='".$pic."' order by re_date asc");
      while($row=@mysql_fetch_array($result))
      {
        $id=$row["re_id"];
        $id1=$row["re_id1"];
    $title=$row["re_title"];
    if(strlen($title)>30)
    {
      $title1=substr($title,0,30);
      $rr="...";
      $title=$title1.$rr;
    }
    else
    {
      $title=$row["re_title"];
    }
        $name=$row["re_name"];    
    $date=$row["re_date"];    
    $readtimes=$row["re_readtimes"];  
        $replytimes=$row["re_replytimes"];
    $content=$row["re_content"]; 
    $num=strlen($content);  
    /*$=$row["re_"];  
        $=$row["re_"];    
    $=$row["re_"];    
    $=$row["re_"];  
    $=$row["re_"]; */ 
      print("<tr bgColor=#eefdff>".
        "<td width=40% class=blue height=25><a href='handphone_input.php?$id'>".$title."</a></td>".
        "<td width=13% class=blue align=center height=25>".$name."</td>".
        "<td width=7% class=blue align=center height=25>".$readtimes."</td>".
        "<td width=7% class=blue align=center height=25>".$replytimes."</td>".
        "<td width=7% class=blue align=center height=25>".$num."</td>".
        "<td width=16% class=blue align=center height=25>".$date."</td>");
    if($session_customer_class=="7" || $session_customer_class=="6")
    {
      print("<td width=5% class=blue align=center height=25><a href='handphone_re_delete.php'>删除</a></td>".
        "<td width=5% class=blue align=center height=25><a href='handphone_re_update.php'>修改</a></td>");
    }
      print("</tr>");  }  
    ?>