MyBB Community Forums

Full Version: number posts list @ Database/mybb_posts, 2 match ACP/Dashboard total ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
.
Is there a way to add a column at the database that shows the actual number of posts (ie 1-26, the actual # of posts, instead of 1...,-...231, per attached scrnshot) ?
Current number of all posts on forum? It's in mybb_stats table as numposts.

If you want to check it in mybb_posts, you can run this query:
SELECT COUNT(*) FROM mybb_posts
.
Thank you for the info !
Still working on SQL, and this also helps with that effort.
Interesting that the actual DB count is 28 (and shown with the SQL you suggested), but the ACP/Dashboard/PHP Version (scnshot attached) count is 26 ?
Reason for that ?
Also, is there any way to add a column at the Database to show the 1-28 (in this case) numbering ?

(2013-11-17, 06:39 PM)Destroy666 Wrote: [ -> ]Current number of all posts on forum? It's in mybb_stats table as numposts.
If you want to check it in mybb_posts, you can run this query:
SELECT COUNT(*) FROM mybb_posts
Run Recounts & Rebuilds in ACP -> Tools & Maintenance and they should be equal.

I don't know what you mean with numbering column... What would you use that for? It's not required for post count, COUNT does the job perfectly and is the most used solution in MySQL for that, I've never seen creating column for this purpose, nor I can't see any other possible usage.

Also pid column is auto-incremented already, but removing posts makes holes. The same would happen to other column, unless there is a trick to preserve the numbers by recounting them on post deletion.
.
Thanks again for the feedback/followup !
Ran R&R, but 'php' did not change from 26 to 28 (actual count).
(2013-11-17, 08:47 PM)Destroy666 Wrote: [ -> ]Run Recounts & Rebuilds in ACP -> Tools & Maintenance and they should be equal.


Numbering column more of a convenience thing, ie not need to run 'SELECT COUNT(*) FROM mybb_posts', and able to help with identify spam.
Quote:I don't know what you mean with numbering column... What would you use that for? It's not required for post count, COUNT does the job perfectly and is the most used solution in MySQL for that, I've never seen creating column for this purpose, nor I can't see any other possible usage.


The recounting 'trick' seems like the need.
Quote:Also pid column is auto-incremented already, but removing posts makes holes. The same would happen to other column, unless there is a trick to preserve the numbers by recounting them on post deletion.