大腿前侧肌肉怎么减:asp代码在取id时

来源:百度文库 编辑:高考问答 时间:2024/04/27 13:54:57
<!--#include file="conn.asp"-->
<%
id=request.QueryString("id")
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from news where id="&id&"",conn,1,3
rs("click")=rs("click")+1
rs.update
%>
<table width="600" border="0" align="center" bgcolor="#EEEEEE">
<tr>
<td height="50" align="center" class="title1"><%=rs("title")%></td>
</tr>
<tr>
<td height="2" align="center" bgcolor="#999999"></td>
</tr>
<tr>
<td align="center" class="text">作者:<%=rs("zuozhe")%>    来源:<%=rs("from")%>    日期:<%=rs("time")%>    点击:<%=rs("click")%></td>

</tr>
<tr>
<td height="10"> </td>
</tr>
<tr>
<td class="text2" style="padding-left:10px;padding-right:10px"><%=rs("content")%></td>
</tr>
<tr>
<td align="right" class="text" style="padding-right:10px">责任编辑:<%=rs("bianji")%></td>
</tr>
</table>
<%
rs.close
set rs=nothing
%>
==========
帮我加上能够实现下面描述的功能
当id为空时,显示最后添加的一条新闻
为0或是为不存在的数字时
显示信息为“你查看的新闻可能已被删除”
谢谢
按着楼下的做了,不行

set rs=server.CreateObject "adodb.recordset")
if id="" then
rs.open "select * from news",conn,1,3
rs.movelast
else
'为0或是为不存在的数字时
if not isnumeric(id) or id=0 then
repsonse.write("为0或是为不存在的数字时 ")
else
rs.open "select * from news where id="&id&"",conn,1,3
rs("click")=rs("click")+1
rs.update
end if
end if
%>