漆黑魅影红蓝水都:asp相关:大家进来看看这段代码。

来源:百度文库 编辑:高考问答 时间:2024/04/27 18:32:57
这个音乐网首页控制表格内,排列顺序的代码。
这段代码的功能是把点击(既Hits,为数据库中点击数)最高的项放在表格最前面,类似排行榜。
谁能帮我改改,我不想要这样的显示方法。我想要的是把最后填加歌曲放在第一位。
数据库中有:ID Wam MusicName Singer NClassID hits isGood

<%
dim i
i=0
page = request.querystring("Hits_Page")
set rs=server.createobject("adodb.recordset")
sql="select id,MusicName,hits,singer from MusicList order by hits desc"
rs.open sql,conn,1,1
if rs.EOF then
response.write "<div align=center>未收录歌曲</div>"
else
rs.pagesize = "201"
if page = "" or page < "1" then
page = "1"
end if
if rs.pagecount > "0" then
rs.absolutepage = page
end if
do while not rs.eof
i=i+1
if i > rs.pagesize then
exit do
end if
%>
<TD width=168><a href="#" title="<%=rs("MusicName")%>" onClick="window.open('YxPlay.asp?id=<%=rs("id")%>','Lcmusic','scrollbars=no,resizable=no,width=383,height=500,menubar=no,top=168,left=168')" > <font color="#000000"><span style="text-decoration: none"><%=rs("MusicName")%></span></font></a></TD>

<% if i mod 5 =0 then%>
<TR align=middle>
<%
end if
if i>=100 then exit do
rs.movenext
loop
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
若帮我改好,送分200。有要求可送更多。

<%
dim i
i=0
page = request.querystring("Hits_Page")
set rs=server.createobject("adodb.recordset")
sql="select id,MusicName,hits,singer from MusicList order by ID desc" '主要是这行代码
rs.open sql,conn,1,1
if rs.EOF then
response.write "<div align=center>未收录歌曲</div>"
else
rs.pagesize = "201"
if page = "" or page < "1" then
page = "1"
end if
if rs.pagecount > "0" then
rs.absolutepage = page
end if
do while not rs.eof
i=i+1
if i > rs.pagesize then
exit do
end if
%>
<TD width=168><a href="#" title="<%=rs("MusicName")%>" onClick="window.open('YxPlay.asp?id=<%=rs("id")%>','Lcmusic','scrollbars=no,resizable=no,width=383,height=500,menubar=no,top=168,left=168')" > <font color="#000000"><span style="text-decoration: none"><%=rs("MusicName")%></span></font></a></TD>

<% if i mod 5 =0 then%>
<TR align=middle>
<%
end if
if i>=100 then exit do
rs.movenext
loop
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
%>

好复杂啊~我不会~