I have a mysql database. I have a column named id which is also the primary key. I have inserted manually till 25. Now I have written a python code to insert into the database. The code for inserting is
c.execute("""INSERT INTO Website (website_name, enabled) VALUES (%s, 0)""", (store_name))
Now, the problem I am having is that the values in the auto_increment column are arbitrary. Like, the value inserted after 25 is 1116. Is there a way to insert them in increasing order?
Thank you
You can get
auto_incrementvalue bylastrowidFor further reference dive How do I get the "id" after INSERT into MySQL database with Python?