Forum Moderators: open

Message Too Old, No Replies

how to add "newer and older forum posts" function

         

musicales

3:20 pm on Jan 25, 2006 (gmt 0)

10+ Year Member



I'd like to add a newer and older posts function to my forum, like the ones on WebmasterWorld. Given the post_id of the current post, is there any easy way to find the 1st older and 1st newer post in one query, rather than having to use two queries on every page?

musicales

3:24 pm on Jan 25, 2006 (gmt 0)

10+ Year Member



sorry, after thinking about it, it's really easy:

select * from posts where postid>=" & (postid-1) & " and postid<=" & (postid+1 )

or something similar