asp在网站的首页新闻的排列按照时间的排序怎么弄,下面代码如何改
<%sqlstr="selecttop23*fromt_newswhereversion='"¤t_ver&"'"myrs.opensqlstr,conn%>...
<%
sqlstr="select top 23 * from t_news where version='"¤t_ver&"'"
myrs.open sqlstr,conn
%>
<%if not myrs.eof then%>
<style type="text/css">
<!--
.style1 {
color: #FF9900;
font-size: 9px;
}
-->
</style>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="36" valign="top"><%do while not myrs.eof
if len(myrs("title"))>22 then
titlestr=left(myrs("title"),18)+"..."
else
titlestr=myrs("title")
end if
%>
<span class="style1">■</span><a href="../news/news_detail.asp?id=<%=myrs("id")%>"> <%=titlestr%></a> <br>
<%
myrs.movenext
loop%>
</td>
</tr>
</table>
<% else%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="59" align="center" background="../images/bgg.jpg">
暂时没有新闻!
</td>
</tr>
<tr align="center">
<td height="2" colspan="3"><img src="../images/006.jpg" width="385" height="1"></td>
</tr>
</table>
<% end if
myrs.close
%> 展开
sqlstr="select top 23 * from t_news where version='"¤t_ver&"'"
myrs.open sqlstr,conn
%>
<%if not myrs.eof then%>
<style type="text/css">
<!--
.style1 {
color: #FF9900;
font-size: 9px;
}
-->
</style>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="36" valign="top"><%do while not myrs.eof
if len(myrs("title"))>22 then
titlestr=left(myrs("title"),18)+"..."
else
titlestr=myrs("title")
end if
%>
<span class="style1">■</span><a href="../news/news_detail.asp?id=<%=myrs("id")%>"> <%=titlestr%></a> <br>
<%
myrs.movenext
loop%>
</td>
</tr>
</table>
<% else%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="59" align="center" background="../images/bgg.jpg">
暂时没有新闻!
</td>
</tr>
<tr align="center">
<td height="2" colspan="3"><img src="../images/006.jpg" width="385" height="1"></td>
</tr>
</table>
<% end if
myrs.close
%> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询