新闻动态 里只显示5条新闻,后台里我改成8条了前台也不变, 从源码里应该怎么样改?

[复制链接]
查看11 | 回复1 | 2011-4-6 03:43:10 | 显示全部楼层 |阅读模式
我把这个位置的qltext4=\"select top 5 * from news where BigClassName=\'企业新闻\' order by id desc\"
5改成8还是不行~
我把代码帖上~
/td

/tr

/tbody

/table

table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"200\" align=\"center\" height=\"8\"

tbody

tr

td/td

/tr

/tbody

/table

table class=\"bk\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"240\" align=\"center\"

tbody

tr

td height=\"270\" valign=\"top\"table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"240\" align=\"center\" height=\"27\"

tbody

tr

td class=\"baicu12\" background=\"imgbsb/left01.jpg\" width=\"90\" align=\"middle\"新闻动态/td

td background=\"imgbsb/left02.jpg\" width=\"100\"/td

td background=\"imgbsb/left02.jpg\" width=\"50\" align=\"middle\"
a href=\"NewsClass.asp?BigClass=企业新闻\"img border=\"0\" src=\"imgbsb/more.gif\" width=\"40\" height=\"12\" //a/td

/tr

/tbody

/table

tableborder=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"220\" align=\"center\" style=\"margin-top:8px;\"

tbody
%
set rs_news=server.createobject(\"adodb.recordset\")
sqltext4=\"select top 5 * from news where BigClassName=\'企业新闻\' order by id desc\"
rs_news.open sqltext4,conn,1,1

%
%i=0
do while not rs_news.eof%

tr

td height=\"25\" width=\"25\" align=\"middle\" class=\"foot_xx\"img src=\"imgbsb/index_36.gif\" width=\"4\" height=\"7\" //td

td width=\"195\" class=\"foot_xx\"a href=\"shownews.asp?id=%=rs_news(\"id\")%\" target=\"_blank\"%=cutstr(rs_news(\"title\"),20)%/a /td

/tr
%rs_news.movenext
i=i 1
if i=5 then exit do
loop
rs_news.close %
回复

使用道具 举报

千问 | 2011-4-6 03:43:10 | 显示全部楼层
<pre id=\"best-answer-content\" class=\"reply-text mb10\">修改2处:
1.select top 5 * from news ...//改为:select top 8 * from news
2.if i=5 then exit do//改为:if i=8 then exit do
----请存盘后,试一试运行效果!!!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行