PHP-Auth
PHP-Auth copied to clipboard
User ID Increment Broken?
Whenever I $auth->register() a new user, I expect it to add a new user with an id 1 value higher than the last registered user, but for some reason, it doesn't seem to do that. The pattern from 1-10 is fine, it's just 1, 2, 3, etc., but after it hits 10, it starts going 11, 21, 31, etc. until it hits what is supposed to be "20," where it then becomes 101, 111, 121, etc. Is this a bug or is it working as intended? Thanks in advance!
Thanks!
This is probably specific to, and caused by, your database engine. What database system are you using? MySQL or MariaDB, PostgreSQL, SQLite, something else? That sequence can usually be configured there.
This library uses AUTO_INCREMENT (for MySQL and MariaDB), SERIAL (for PostgreSQL) and AUTOINCREMENT (for SQLite) in its database tables, as you can see in the Database folder.
I'm using MySQL, and I found the file. What should I do to troubleshoot the issue?
Please try searching for “increment” on the following page:
https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html
Look up these configuration values and see if they need to be changed.
If you’re using InnoDB as your engine, the following might also help:
https://dev.mysql.com/doc/refman/8.0/en/innodb-auto-increment-handling.html
And, finally, if you’re using replication, the following two pages might be of help:
https://dev.mysql.com/doc/refman/8.0/en/replication-features-auto-increment.html
https://dev.mysql.com/doc/refman/8.0/en/replication-options-master.html