关于文章浏览里的上一条和下一条的实现方法
2006-02-20 13:18
525 查看
<a href="content.asp?pev=<%=rs("id")%>">上一条</a> <a href="content.asp?last=<%=rs("id")%>">下一条</a>
If pev="" And last="" then
sql="select * from informains where chk='1' and id=" & CInt(id)
Else
If pev<>"" Then
sql="select top 1 * from informains where chk='1' and id<" & CInt(pev) & " order by id desc"
End If
If last<>"" Then
sql="select top 1 * from informains where chk='1' and id>" & CInt(last)
End if
End If
注意看上面的SQL语句!
If pev="" And last="" then
sql="select * from informains where chk='1' and id=" & CInt(id)
Else
If pev<>"" Then
sql="select top 1 * from informains where chk='1' and id<" & CInt(pev) & " order by id desc"
End If
If last<>"" Then
sql="select top 1 * from informains where chk='1' and id>" & CInt(last)
End if
End If
注意看上面的SQL语句!
相关文章推荐
- [Android初级]关于实现在阅读文章后保持上次阅读位置的方法即关于ScrollView的位置监听
- Linq获取上一条和下一条数据的方法
- jQuery+ajax实现文章点赞功能的方法
- 3-11 Yii2框架博客系统文章创建create方法实现 观察者模式,高内聚,低松耦合
- 关于用mongodb java api 来实现在$project中使用$substr函数的方法
- 关于百度地图 BMap.InfoWindow 只显示最后一条信息解决方法
- 关于毕业设计的各模块的实现方法
- .NET中关于伪静态的实现方法
- 关于wordpress 点击文章查看内容跳转加载失败(404)的解决方法
- 关于实现外部阅读系统信箱内容的方法总结
- php实现文章置顶功能的方法
- DedeCMS文章列表每5隔行加横线的实现方法
- 关于抽象类和接口中含有相同方法的实现的一点思考
- 关于SQL行列转置的实现方法(转)
- 关于获取每一条查询语句的记录数的方法总结
- 转载:自定义浏览DWG控件的实现方法, 有时间研究一下(AcGsView使用)
- 实现PHP框架系列文章(6)mysql数据库方法
- 实现PHP框架系列文章(6)mysql数据库方法
- 关于使用HTML或JS实现页面重定向的方法
- 关于两个时间(00:00:00)相加的实现方法