• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Check for the nth post - count

Brogan

XenForo moderator
Staff member
#2
Hmmm, this is easy for a thread as you just change the ID to 2000 but for a post it needs the thread ID.

I can't find an obvious way of doing it without querying the DB.
 

Jake Bunce

XenForo moderator
Staff member
#10
Note that selecting the 2000th post by postid will ignore gaps in the postid values. Gaps are created when posts are deleted.

This query will select the 2000th post record of the posts that currently exist:

Code:
SELECT *
FROM xf_post
ORDER BY post_id
ASC
LIMIT 1999, 1
One method is not more correct than the other. It just depends on how you want to identify the 2000th post.