'======================上篇文章===============================
<span class="style1">.上篇文章:</span><span class="style2">
<% set rs1=server.createobject("adodb.recordset")
sql="select * from art where art_id<"&cint(request("art_id"))&" order by art_date desc"
rs1.open sql,conn,1,3 %>
<a href="?artcat_id=<%= rs1("artcat_id") %>&art_id=<%= rs1("art_id") %>"><%= rs1("art_title") %></a>
<% If rs1.eof and rs1.bof Then %>
没有上篇文章了</span>
<% End If %>
'======================下篇文章===============================
<span class="style1">.下篇文章:</span><span class="style2">
<% set rs2=server.createobject("adodb.recordset")
sql="select * from art where art_id>"&cint(request("art_id"))&" order by art_id desc"
rs2.open sql,conn,1,3 %>
<a href="?artcat_id=<%= rs2("artcat_id") %>&art_id=<%= rs2("art_id") %>"><%= rs2("art_title") %></a>
<% If rs2.eof and rs2.bof Then %>
没有下篇文章了</span>
'======================相关文章===============================
.相关文章:
<span class="style2">
<% set rs3=server.createobject("adodb.recordset")
sql="select * from art where art_content like '%"&rs("art_content")&"%' and art_id<>"&rs("art_id")&" order by art_id desc"
rs3.open sql,conn,1,3
do while not rs3.eof and k<5%>
<a href="?artcat_id=<%= rs3("artcat_id") %>&art_id=<%= rs3("art_id") %>"><%= rs("art_title") %> </a>
<% rs3.movenext
k=k+1
loop %>
<% If rs3.eof and rs3.bof Then %>
没有相关文章
<% End If %>
</span>
更多的[原创]上篇和下篇文章,相关文章的ASP代码请到论坛查看: http://BBS.TC711.COM
【 双击滚屏 】 【 评论 】 【 收藏 】 【 打印 】 【 关闭 】
来源:
互联网
日期:2006-5-20