| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 404 人关注过本帖
标题:上一篇和下一篇代码-主题-显示不出来
只看楼主 加入收藏
osvi
Rank: 1
等 级:新手上路
帖 子:12
专家分:0
注 册:2011-7-25
结帖率:50%
收藏
已结贴  问题点数:10 回复次数:1 
上一篇和下一篇代码-主题-显示不出来
dim preid,nextid
set rst=server.CreateObject("adodb.recordset")
set rst=conn.execute("select max(id) from news where id<"&rs("id"))
preid=rst(0)
if isnull(preid) or preid=0 then
    preid=rs("id")
end if
set rst=conn.execute("select min(id) from news where id>"&rs("id"))
nextid=rst(0)
if isnull(nextid) or nextid=0 then
    nextid=rs("id")
end if
set rst=nothing


<!--代码位置-->

上一篇:<a href= "maker.asp?id=<%=preid%>"><%=rs("title")%></a>


大家帮我看看,这段代码, 我是希望上一篇后面能 显示出该篇的主题。 我现在的这个<%=rs("title")%>显示出来的是当前篇的主题。
请帮忙看看,谢谢

我是想要类似:
上一篇: 香港某大学最新新闻
下一篇: 知名媒体华丽转身

[ 本帖最后由 osvi 于 2012-5-19 14:56 编辑 ]
搜索更多相关主题的帖子: 位置 位置 nothing nothing where where 主题 主题 
2012-05-19 06:47
wangjy500
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:贵宾
威 望:13
帖 子:457
专家分:2569
注 册:2010-7-11
收藏
得分:10 
dim preid,nextid,ptitle,ntitle
set rst=server.CreateObject("adodb.recordset")
set rst=conn.execute("select max(id) from news where id<"&rs("id"))
preid=rst(0)
ptitle=rst(1)
if isnull(preid) or preid=0 then
    preid=rs("id")
   ptitle=rs("title")
end if
set rst=conn.execute("select min(id) from news where id>"&rs("id"))
nextid=rst(0)
ntitle=rst(1)
if isnull(nextid) or nextid=0 then
    nextid=rs("id")
   ntitle=rs("title")
end if
set rst=nothing

上一篇:<a href= "maker.asp?id=<%=preid%>"><%=ptitle%></a>

QQ:63572063
2012-05-20 19:59
快速回复:上一篇和下一篇代码-主题-显示不出来
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.024318 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved