哪位大虾可以帮帮忙,有关SQL的问题

来源:百度知道 编辑:UC知道 时间:2024/06/30 09:41:51
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="bottom" bgcolor="#DDDDDD"><a href=more.asp?uname=<%=uname%>&id=<%=crs("id")%>><%=trim(crs("cname"))%> more...</a></td>
</tr>
<tr>
<td bgcolor="#DDDDDD" height="3" valign="top"><hr></td>
</tr>
<tr>
<td height="10"></td>
</tr>
<%
cid=Int(trim(crs("id")))
set nrs=conn.execute("select top 5 * from news where uname='"&uname&"' and categoryid="&cid&" order by id desc")
do while not nrs.eof

a_time=FormatDateTime(nrs("news_time"))
if Len(minute(a_time))=1 then
a_minute="0"&minute(a_time)
else
a_min

1.这是一个新闻发布页面,是个首页.
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="bottom" bgcolor="#DDDDDD"><a href=more.asp?uname=<%=uname%>&id=<%=crs("id")%>><%=trim(crs("cname"))%> more...</a></td> '显示more一个链接,指向详细的新闻发布面面.
</tr>
<tr>
<td bgcolor="#DDDDDD" height="3" valign="top"><hr></td>
</tr>
<tr>
<td height="10"></td>
</tr>
<%
cid=Int(trim(crs("id"))) '获取新闻id号,存入变量cid
set nrs=conn.execute("select top 5 * from news where uname='"&uname&"' and categoryid="&cid&" order by id desc")'查找前五个新闻记录,存入记录集nrs中.
do while not nrs.eof '当nrs记录集不为空

a_time=FormatDateTime(nrs("news_time&q