Welcome to Geeklog, Anonymous Wednesday, May 08 2024 @ 10:38 am EDT

Geeklog Forums

UID for new users


Status: offline

LWC

Forum User
Full Member
Registered: 02/19/04
Posts: 818
It seems the UID new users get is not always in sequence. I mean, it always gets increased, but not always by 1 (e.g. user 5 gets uid 5 and user 6 get uid 7).

Is it because I deleted users from time to time or dissaproved their requests?

If so, how can I at least make sure a new user would get the first really available uid (e.g. if the newest user is 10 and has uid 10, but he's only the newest because I deleted some users after 10, how can I make sure the new user, which would be 11, gets uid 11 and not, say, 25)?

In other words, where does Geeklog look in when it asks itself "which UID should I give the new user"?
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
The uid is an auto_increment field in MySQL, i.e. MySQL ensures that the uid is incremented and not reused.

bye, Dirk
 Quote

Status: offline

LWC

Forum User
Full Member
Registered: 02/19/04
Posts: 818
Is it "yes" for my first question then ("is it because...")?

Why can't a lost UID be reclaimed?

And is there a "current/next" auto_increment field in MySQL that can be changed?
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by LWC: Why can't a lost UID be reclaimed?

Honestly: Who cares?

If you really, desperatly want it, then please look it up in the MySQL manual.

bye, Dirk
 Quote

Status: offline

LWC

Forum User
Full Member
Registered: 02/19/04
Posts: 818
Can I at least easily change a user's existing UID?
 Quote

Status: offline

jetshack

Forum User
Full Member
Registered: 06/29/04
Posts: 122
Location:Texas
yes you can change it

you'll have to do so in the database... phpadmin works great...

you can't change it through geeklog...

but I'm with Dirk... what difference does it make... seriouslly... I'm interested why you want to change it.
 Quote

Status: offline

LWC

Forum User
Full Member
Registered: 02/19/04
Posts: 818
Well, of course I'll use PHPMyAdmin, but what should I change there? Simply user X's UID in gl_users?

I guess it just annoys me that it reaches high numbers because I experimented in adding users...also, I'm trying to create a new form that would use profiles.php and in which the UID would be selected according to the subject (which would be a story's title - I've already made a function that looks inside all of the stories and returns a list of titles accordingly).

I thought about doing an array of ("story 1's title", "story 2's title", etc.) and then match the correct user's UID using a "for" loop (if the selected story's title matches the one in the array, use UID $i). But I can't use a "for" loop if the UIDs aren't in sequence.

However, I realize it's much smarter to just sit once and change each story's author to the user who should get e-mail about this story. Although it annoys me to give them credit for stories which writing they've had nothing to do with (it's a commercial site and I get paid to write these stories)...then again, I've hidden the author anyway in non-editing view, so no one would have a reason to think they wrote them anyway...

...and it annoys me that it reaches high numbers... Wink
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by LWC: Can I at least easily change a user's existing UID?

Change - yes, easily - not really ...

The uid is used in a lot of tables. It's what Geeklog uses to identify a user. So you'll find it in all the user* tables, in stories, comments, gl_group_assignments, in tables used by plugins, etc. etc.

bye, Dirk
 Quote

All times are EDT. The time is now 10:38 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content