Welcome Guest, Not a member yet? Register   Sign In
Using db insert in CI3 auto increment off in table?
#2

(This post was last modified: 05-18-2023, 11:30 PM by JustJohnQ.)

This is more a mySQL problem than a CI problem. Depending on how you have reset the autoincrement for the id field, it might be that there are some gaps in the id, causing mySQL to think that it can autoincrement starting at a lower value than the actual highest id.
Check the autoincrement value using:
Code:
SHOW TABLE STATUS LIKE 'table_name'
My guess is that the value is lower than 10084, the id that exists in your table.
Set the autoincrement one higher than the absolute highest value in your table:
Code:
ALTER TABLE table_name AUTO_INCREMENT=10085;

Now, mySQL will autoincrement as expected.
Reply


Messages In This Thread
RE: Using db insert in CI3 auto increment off in table? - by JustJohnQ - 05-18-2023, 11:29 PM



Theme © iAndrew 2016 - Forum software by © MyBB