MyBB Community Forums

Full Version: UID Question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Quick question, I have rougly 800 members on my forum.

http://infinity-forums.net/

I was wondering if I would be able to access the database and recount the UIDs without breaking anything.

Obviously I'd back up the database before I do it, but I want to know if it will break anything.
I second this question, does anyone know how to do this? I posted a thread earlier asking for something very similar to this.

Because there's no point in having say, 5 registered users, if the UID of the last registered user is 10,603 because of all the deleted spambots.

Is there any way of doing this?
Not easily. The trouble is if you manually edit a person's UID it can lead to collisions so your forum would not work until that gets fixed. The column "uid" is also used in many tables so it would be a big job to get everything updated correctly.
Surely a script could be created to do this automatically for all the tables, couldn't it?
(2014-11-06, 11:18 AM)Greg Winston Wrote: [ -> ]Surely a script could be created to do this automatically for all the tables, couldn't it?

Technically it could if you know all the changes that need to be done.
No worth the time.
You would need to change the uid in the users table, and then go through all other tables and perform an update query for each uid. You'd be looking at something like 20,000 queries.
(2014-11-06, 12:05 PM)dragonexpert Wrote: [ -> ]
(2014-11-06, 11:18 AM)Greg Winston Wrote: [ -> ]Surely a script could be created to do this automatically for all the tables, couldn't it?

Technically it could if you know all the changes that need to be done.

I am new to MySQL but surely it wouldn't be that difficult.

You just find the UID 'X' and replace it with 'X', for all the tables that have UID as the column name.

Or is it more complicated, and I am not aware of it?
It is going to be a lot more complicated than you think. Its also a massive ton of queries. If you don't do things in the correct order you can also break stuff really fast. If you manually edit "uid" there is no way to figure out what it was before the edit. Even I would have trouble doing such a thing and I'm very advanced at PHP and MySQL.
Ok. Could this be a new feature in MyBB 2.0 then, or wouldn't it be necessary?

It just looks bad when the UID has reached past 10,000 and I have 2 members registered. Can I do anything about this?
Pages: 1 2 3