asp排行榜

来源:百度知道 编辑:UC知道 时间:2024/05/21 22:10:40
<%
Set rs= Server.CreateObject("ADODB.recordset")
rs.open "Select top 10 * from 产品 where 类型='类型' order by 点击 desc",lj,1,1
Do until rs.eof
%>
<tr><a href="MoNi-open.asp?id=<%Response.Write(rs("id"))%>">
<td height="25" align="center" bordercolor="#FFFFFF" bgcolor="#E2E2E2" onmouseover="this.style.color='#FFFFFF';this.style.backgroundColor='#999999';" onmouseout="this.style.color='#000000';this.style.backgroundColor='#E2E2E2';"><span class="style7"><%Response.Write(rs("名称"))%></span></td>
</a></tr>
<%
Rs.movenext
Loop
rs.close
set rs=nothing
%>

如何在标题前面 输出 第一名 2 3 4 5 6 7 8 9 10
还有在1 2 3标题前面输出 1 2 3张不同的小图片

方法一:在123标题前加判定语句,输入片,比如 if rs("id")=1 then response.write("<img src='.....'")....

方法二,在界面设计的时候吧1 2 3 的位置弄成图片的--------一般的做法是这样的。

至于输出第一名 2 3 4 那个和这个思想是一样的。

Set rs= Server.CreateObject("ADODB.recordset")
rs.open "Select top 10 * from 产品 where 类型='类型' order by 点击 desc",lj,1,1
Do until rs.eof
%>
<tr><a href="MoNi-open.asp?id=<%Response.Write(rs("id"))%>">
<td height="25" align="center" bordercolor="#FFFFFF" bgcolor="#E2E2E2" onmouseover="this.style.color='#FFFFFF';this.style.backgroundColor='#999999';" onmouseout="this.style.color='#000000';this.style.backgroundColor='#E2E2E2';"><span class="style7"><%Response.Write(rs("名称"))%></span></td>
</a></tr>
<%