php的显示记录 不指定

Else , 2007/05/27 23:20 , 代码片段,演示也有 , Comments(0) , Reads(2375) , Via Original
好久没有弄了,复习一下!

<div id="topname">::热门话题</div>
<?php
$query_top_rs = "SELECT id,title FROM ruby WHERE view=1 order by countruby desc LIMIT 0,10";    
//The updated article 10
$top_rs = mysql_query($query_top_rs, $conn) or die(mysql_error());
$row_top_rs = mysql_fetch_assoc($top_rs);
do { ?>
  <div id="toplist">
  <img src="images/arrow_list.gif" width="13" height="11" /><a href=/show.php/<?php echo $row_top_rs['id']; ?>.html
  title="<?php echo $row_top_rs['title']; ?>"
  target="_blank"
  ><?php echo cnSubStr($row_top_rs['title'],28); ?>
  </a>
  </div>
<?php } while ($row_top_rs = mysql_fetch_assoc($top_rs));
mysql_free_result($top_rs);//Memory release
?><br/>
Tags: ,
Add a comment

Nickname

Site URI

Email

Enable HTML Enable UBB Enable Emots Hidden Remember [Login] [Register]