asp论坛显示上一篇下一篇的问题

来源:百度知道 编辑:UC知道 时间:2024/05/24 14:28:58
<!--#include file="d_tou.asp" -->
<!--#include file="d_ubb.asp" -->
<%
tiezi=clng(Request("tiezi"))
if tiezi="" then
tiezi=0
end if
set zhutie=lj.execute("select * from tiezi where xuhao="& tiezi &"")
if not zhutie.eof then
lj.execute("update tiezi set liulan=liulan+1 where xuhao="& tiezi &"")
xuhao=zhutie("bankuai")
set bankuai=lj.execute("select mingzi from bankuai where xuhao="& xuhao &"")
%><body background="img/1.jpg">
<table width="98%" border="0" align="center" cellpadding="5" cellspacing="0">
<tr>
<td height="40"><img src="tupian/weizhi.gif" width="9" height="9"> <a href="b_bankuai.asp">论坛版块</a>

根据你的页面,调试好了。

<%
set rs_p=lj.execute("select top 1 * from tiezi where xuhao<"+ cstr(tiezi) +" order by xuhao desc")

set rs_n=lj.execute("select top 1 * from tiezi where xuhao>"+ cstr(tiezi) +" order by xuhao asc")
%>

<a href="?tiezi=<%=rs_p("xuhao")%>">
上一篇:<%=rs_p("biaoti")%>
</a>    

<a href="?tiezi=<%=rs_n("xuhao")%>">
下一篇:<%=rs_n("biaoti")%>
</a>