地下城与勇士任务攻略:难解呀,ASP问题。

来源:百度文库 编辑:杭州交通信息网 时间:2024/05/06 07:43:06
下面那段代码是关于电影点击率排行,现在排行是10行,我需要改为显示20行。应该怎么改?

<%
dim bentop30,strSQL1,top30
strSQL1 ="SELECT * FROM film WHERE dateandtime>=date()-30 ORDER BY hits DESC"
Set bentop30 = Server.CreateObject("ADODB.Recordset")
bentop30.open strSQL1,Conn,0,1
top30=1
if bentop30.eof then
response.write "<font color='#ffffff'>本月内新电影没被观看</font>"
else
do while not bentop30.eof
if not bentop30.eof then
%>
</b></font>
<table id=NewFilm1_myDataList
style="BORDER-RIGHT: #343d47 2px; BORDER-TOP: #343d47 2px; BORDER-LEFT: #343d47 2px; COLOR: black; BORDER-BOTTOM: #343d47 2px; BORDER-COLLAPSE: collapse; BACKGROUND-COLOR: #5b5c5e"
bordercolor=#343d47 cellspacing=0 cellpadding=1
rules=cols border=2 width="164">
<tbody>
<tr>
<td style="BACKGROUND-COLOR: #5b5c5e" noWrap height="13" width="135"><a href=soft.asp?id=<%=bentop30("id")%>&typeid=<%=bentop30("typeid")%>&zhuid=<%=bentop30("zhuid")%> target="_blink"><font color="#FFFFFF"><%=bentop30("title")%></font></a></td>
<td style="BACKGROUND-COLOR: #5b5c5e" noWrap height="13" width="17"><font color=red><%=bentop30("hits")%></font></td>
</tr>
</tbody>
</table>
<%bentop30.movenext
end if
top30=top30+1
if bentop30.eof or top30>rs1("newshu") then
exit do
end if
loop
bentop30.close
set bentop30=nothing
end if%>

用SQL语句选出前30,可以节省很多的服务器资源,比你那个快多了
例如
select top 30 from table order by hits desc
选出点击前30的
for i=1 to 30
response.write(....)
....
next

top30>rs1("newshu")
直接把rs1("newshu")改成20即可。

top30> rs1("newshu")
rs1("newshu")改成20就可以了!
这个应该是在后台可以改的!
不用那么麻烦改ASP文件!