<?php $sql = mysql_query("select * from tuijian where lei='门票热荐'");
$info=mysql_fetch_array($sql);
while($info){
?>
                    <tr>
                      <td><ul>
                        <li><u>
                          <?php echo $info[name];?></u>
                        </li>
                      </ul></td>
                      <td align="center"><span class="STYLE39">¥<?php echo $info[msj]; ?>
                      </span></td>
                      <td align="center"><span class="STYLE39">¥<?php echo $info[bbyj];?>
                      </span></td>
                    </tr><?php }?><?php mysql_free_result($sql);?>
                  </table></td>
                </tr>像这种代码一共有四处,一个页面上,是不是我这个导致太卡了?

解决方案 »

  1.   

    $sql = mysql_query("select * from tuijian where lei='门票热荐'");while($info = mysql_fetch_array($sql);){
    ?>
    <tr>
      <td><ul>
    <li><u>
      <?php echo $info[name];?></u>
    </li>
      </ul></td>
      <td align="center"><span class="STYLE39">¥<?php echo $info[msj]; ?>
      </span></td>
      <td align="center"><span class="STYLE39">¥<?php echo $info[bbyj];?>
      </span></td>
    </tr>
    <?php 
    }
    mysql_free_result($sql);
    ?>
    </table></td>
    </tr>
      

  2.   

    这是死循环
                        $info=mysql_fetch_array($sql);
                        while($info){这两行这么改
    //前面一行不需要了
                        while($info = mysql_fetch_array($sql)){