显示上一篇和下一篇标题的代码,怎么实现不了??
<%pid1=rs("id")
function Getpre
sql="select top 1 * from news where id>"&pid1&" order by id"
set rs=conn.execute(sql)
if rs.eof or rs.bof then
response.Write("没有新闻了")
else
pid2=rs("id")
response.Write("<a href='shownews.asp?id="&pid2&"'>"&rs("title")&"</a>")
end if
end function
function Getnext
sql="select top 1 * from news where id<"&pid1&" order by id desc"
set rs=conn.execute(sql)
if rs.eof then
response.Write("没有新闻了")
else
pid3=rs("id")
response.Write("<a href='shownews.asp?id="&pid3&"'>"&rs("title")&"</a>")
end if
end function
%>