PDA

View Full Version : Userid Auto Increment Issue


boxingscene
10-31-2016, 09:35 PM
I've noticed as of late that our User IDs in mysql are not in order. (VB 3.8.2)

I guess somewhere along the line a few numbers got skipped and the system started filling those skipped numbers and now they are all over the place.

Someone might register right now and get a User ID (not yet taken) that is two pages back.

The issue is causing some errors. Some users complain they don't receive registration emails and I, at times, don't receive notifications of their registrations.

Not exactly sure how to correct this. The numbers are all there (when I click to view by numerical order) but the USER IDs are not in numerical order when clicking on the table in normal fashion.

Paul M
10-31-2016, 10:21 PM
If you dont view them with a sort order set, then they are not going to necessarily be listed in order, MySQL does not care about storing rows in any order internally.

boxingscene
10-31-2016, 10:29 PM
If you dont view them with a sort order set, then they are not going to necessarily be listed in order, MySQL does not care about storing rows in any order internally.

That makes sense. My developer just told me because my database is so big (almost 30 gigs) that phpmyadmin is not necessarily going to sort that much date in numerical order.

When I ran a test query below, everything came up fine and in order with no IDs skipped.

SELECT * FROM `user` WHERE `userid` BETWEEN 12986000 AND 12986500 ORDER BY `userid` ASC limit 0,100