西安哪家大药房药最全:ASP问题:为什么我的新闻图片总显示最早的一个?

来源:百度文库 编辑:杭州交通信息网 时间:2024/05/09 19:51:14
ASP代码如下:
<%SQL="Select * from product where pro_name='news' and img is not null"
Set rs=server.CreateObject("ADODB.RecordSet")
rs.Open SQL,con,3,2
if not rs.eof then
%>
<table width="182" height="194" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td rowspan="4" background="../images/index_05.jpg" width="11" height="155"></td>
<td colspan="3">
<img src="../images/index_06.jpg" width="160" height="27"></td>
<td rowspan="4" background="../images/index_05.jpg" width="11" height="155"></td>
</tr>
<tr>
<td colspan="3" bgcolor="#999999" width="160" height="1"></td>
</tr>
<tr>
<td rowspan="2" bgcolor="#999999" width="1" height="127"></td>
<td bgcolor="#FFFFFF" width="158" height="126"><img src="admin/img/<%=rs("img")%>" width="158" height="126"></td>
<td rowspan="2" bgcolor="#999999" width="1" height="127"></td>
</tr>
<tr>
<td bgcolor="#999999" width="158" height="1"></td>
</tr>
<tr>
<td colspan="5" rowspan="2" bgcolor="#FFFFFF" width="182" height="39" align="center" class="link2">
<a href="news_more.asp?id=<%=rs("id")%>"><%=rs("title")%></a></td>
</tr>
</table>
<%
end if
rs.Close
Set rs=nothing
%>

网站地址是:www.chinashanxin.com
如何让首页的新闻图片显示最新更新的新闻?
目前的新闻图片只显示数据库中最早的新闻。
请高手给予解决。

你的查询语句这样写:
Select * from product where pro_name='news' and img is not null order by 你的添加时间或者有自动编号的ID desc