MyBB Community Forums

Full Version: wrong forum state !!!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hello
i have 6530 member (last uid=6530)
but my forum state shows 6482 !
I reset the statistics from admincp but it didn't work
Then I used the following commands in the database:
ALTER TABLE mybb_users AUTO_INCREMENT = 6530;

and also

ALTER TABLE mybb_users AUTO_INCREMENT = 6482;

But no change . How can I solve this problem? Huh
So, your forum should be indeed have 6482 users. No problem at all.

Try this SQL query to get the number of records in your database:
SELECT COUNT(*) FROM mybb_users;

The AUTO_INCREMENT setting means the next index value (uid) of next user to be added into will be used, see also https://dev.mysql.com/doc/refman/8.0/en/...ement.html
(2019-09-08, 02:56 PM)noyle Wrote: [ -> ]So, your forum should be indeed have 6482 users. No problem at all.

Try this SQL query to get the number of records in your database:
SELECT COUNT(*) FROM mybb_users;

The AUTO_INCREMENT setting means the next index value (uid) of next user to be added into will be used, see also https://dev.mysql.com/doc/refman/8.0/en/...ement.html

Thanks . But how can I match both?
I think it's easier if I edit the statistics. but how ?
[attachment=42177]
(2019-09-08, 03:08 PM)DJMOKHTAR Wrote: [ -> ]Thanks . But how can I match both?
I think it's easier if I edit the statistics. but how ?

You're welcome.

I'll try to explain but it might not be clear.

To not mix the user indices (uid) with each other, which are used in other tables (for other modules in MyBB or plugins, or even reference it from outside your forum), a unique ID should be used for user index, thus this "uid" will be auto increased when a new user is registered. The record in mybb_users table for an existing user will be deleted if you remove this user in MyBB's AdminCP. Then a new user will get a unique ID which is auto increased if new users register, and there will be such an unmatched situation.

Let's say you have bought some umbrellas on different days, a red umbrella on Apr. 6, a blue umbrella on Aug. 18 and a green umbrella on Sept. 30 and you numerically named them uniquely with just "first", "second", and "third". One day, you lost the blue one and you'll have only two umbrellas which are the "first" and the "third". So you really want to change the name of the green umbrella to "second" which is the name of the blue one?

Ah... what an absurd story..

Why do you need to maintain such a match?

BTW, you really shouldn't try to match the two values, otherwise your forum may be broken.
No one (but some admins) actually cares about UIDs or whether the last registration UID and the user count actually match. A forum where there's no deleted accounts would probably either be very small (like 20 users) or look suspicious to me.
Do not forget to set the auto-increment valuie back to its original - else the database can get in trouble with a next registered user.
ALTER TABLE mybb_users AUTO_INCREMENT = 6530;

Do not care the auto-increment. That is database internal counting and should not be touched manually when there is no serious reason.

[ExiTuS]
use the recount and rebuild tool .