How are user_id's created?

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Locked
shamca
Registered User
Posts: 12
Joined: Sat Oct 11, 2008 11:09 am

How are user_id's created?

Post by shamca » Thu Nov 13, 2008 2:58 am

I see that the table is not auto_increment...how/where is the value generated?

Appreciate any assistance,
Shaun

User avatar
Dog Cow
Registered User
Posts: 2494
Joined: Fri Jan 28, 2005 12:14 am
Contact:

Re: How are user_id's created?

Post by Dog Cow » Thu Nov 13, 2008 3:29 am

By selecting the highest user_id and adding one to it.
Moof!
Mac GUI Vault: Retro Apple II & Macintosh computing archive.
Inside Allerton bookMac GUIMac 512K Blog

espicom
Registered User
Posts: 17905
Joined: Wed Dec 22, 2004 1:14 am
Location: Woodstock, IL

Re: How are user_id's created?

Post by espicom » Thu Nov 13, 2008 8:45 pm

And it isn't auto-increment because AI columns cannot have negative numbers... and user ID -1 is used for Anonymous (the guest user).
Jeff
Fixing 1016/1030/1034 Errors | (obsolete link) | MySQL 4.1/5.x Client Error | phpBBv2 Logo in ACP
Support requests via PM are ignored!
"To be fully alive is to feel that everything is possible." - Eric Hoffer

User avatar
Dog Cow
Registered User
Posts: 2494
Joined: Fri Jan 28, 2005 12:14 am
Contact:

Re: How are user_id's created?

Post by Dog Cow » Thu Nov 13, 2008 10:18 pm

But you could make it auto-increment if you changed the guest user id to 0 and updated the constant for ANONYMOUS and DELETED.
Moof!
Mac GUI Vault: Retro Apple II & Macintosh computing archive.
Inside Allerton bookMac GUIMac 512K Blog

Locked

Return to “2.0.x Support Forum”