Check for the nth post - count

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.
 
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.
 
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.
I'm trying to find out who posted the actual 500,000th post on my forum.

I tried this query on my XF2 forum database and the result was the same post I got from going to http://www.mydomain.xyz/posts/500000

The 'Messages' count in the widget in my sidebar is keeping a different post count, it appears to be taking into account the deleted posts.

I want to know who posted the 500,000th post on my forum according to the sidebar widget.

Is that possible at all?
 
Top Bottom