文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>上一篇、下一篇函数

上一篇、下一篇函数

时间:2010-10-11  来源:mx11

<%
'定义一个nextrs函数来找出下一篇的ID  
function nextrs
nextrsd=server.CreateObject("adodb.recordset")
sql="select top 1 * from Product where Product_id>"&request("Product_id")&" order by Product_id"
set nextrsd=conn.execute(sql)
if nextrsd.eof then
response.Write "已经是最后一个产品 "
else
id1=nextrsd("Product_id")
response.Write "<a href='product.asp?action=view&id="&id1&"'' class='ad'><strong>下一产品</strong></a> "  
end If
nextrsd.close
end function 
'定义一个backrs函数来找出上一篇的ID
function backrs
backrsd=server.CreateObject("adodb.recordset")
sql="select top 1 * from Product where Product_id<"&request("Product_id")&" order by Product_id desc"
set backrsd=conn.execute(sql)
if backrsd.eof then
response.Write "已经是第一个产品"
else
id2=backrsd("Product_id")
response.Write "<a href='product.asp?action=view&id="&id2&"' class='ad'><strong>上一产品</strong></a>"
end If
backrsd.close
end function
%>
相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载