急!急!急!!!asp显示顺序问题

来源:百度知道 编辑:UC知道 时间:2024/05/07 21:02:26
帮我看看这一串代码,怎么它开着不是显示的不是最新的,而是最旧的呢
是哪里错了呢
帮忙看一下啦,挺急的,我的水平又不高,谢谢各位大姐姐们和大哥哥们啦
说的详细一点呀,嘿嘿,只要说哪改,怎么改就OK啦
先祝大家新年快乐啦^_^
<%
sql="select top 8 id,caption,puttime from newsinfo where subject='0'"
rs.open sql,conn,1,3
%>
</span>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<%do until rs.eof%>
<tr>
<td height="24"><IMG HEIGHT=13 SRC="images/bog1.jpg" WIDTH=14> <a href="#" class="zhengwen STYLE6 STYLE7" onClick="MM_openBrWindow('news.asp?id=<%=rs("id")%>','','scrollbars=yes,width=520,height=350')"><%=rs("caption")%></a></td>

<%
sql="select top 8 id,caption,puttime from newsinfo where subject='0' Order By id Desc"
'Desc从大到小排列,Asc则反之
rs.open sql,conn,1,3
%>
</span>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<%do until rs.eof%>
<tr>
<td height="24"><IMG HEIGHT=13 SRC="images/bog1.jpg" WIDTH=14> <a href="#" class="zhengwen STYLE6 STYLE7" onClick="MM_openBrWindow('news.asp?id=<%=rs("id")%>','','scrollbars=yes,width=520,height=350')"><%=rs("caption")%></a></td>
</tr>
<%rs.movenext%>
<%loop%>
<%rs.close%>

在查询语句sql="select top 8 id,caption,puttime from newsinfo where subject='0' order by 这填你想按那个字段排序的字段 Desc"
加上desc 就是倒序显示,也就是显示最新的,如是汉字开关的