标签:函数 serve 上下 func from create .exe amp 定义
<%
‘定义一个nextrs函数来找出下一篇的ID
function nrs
nrs=server.CreateObject("adodb.recordset")
sql="select * from articles where id>"&a1&" order by id"
set nrs=conn.execute(sql)
if nrs.eof then
response.Write"下一篇:这是本分类下的最后一篇文章"
else
a2=nrs("id")
response.Write"下一篇:<a href=‘article.asp?id="&a2&"‘>"&nextrsd("title")&"</a>"
end if
end function
‘定义一个backrs函数来找出上一篇的ID
function brs
brs=server.CreateObject("adodb.recordset")
sql="select top 1 * from articles where id<"&a1&" order by id desc"
set brs=conn.execute(sql)
if brs.eof then
response.Write "上一篇:这是本分类下的第一篇文章"
else
a0=brs("id")
response.Write "上一篇:<a href=‘article.asp?id="&a0&"‘>"&brs("title")&"</a>"
end if
end function
‘取得传递过来的文章ID
set rs=conn.execute(sql)
sql="select * from articles where id="&request("id")
a1=rs("id")
%>
标签:函数 serve 上下 func from create .exe amp 定义
原文地址:https://www.cnblogs.com/ince/p/9154890.html