MySQL Insert ID
#2

https://www.bram.us/2008/07/30/mysql...fromfor-table/

^ shows what your next AUTO_INCREMENT value will be. Store that in a variable, and write a condition to check the value against your limit.

Besides, AUTO_INCREMENT starts from 1 and not 0 by default. To reset the AUTO_INCREMENT, perform an ALTER request for the table in question:

Код:
ALTER TABLE table_name_here AUTO_INCREMENT = 1
Even if you change the 1 to a 0, the AUTO_INCREMENT will still be set to 1 unless you modified your server settings to omit the above condition.

EDIT: Why are you doing this, by the way? Can you describe more of your situation?
Reply


Messages In This Thread
MySQL Insert ID - by NoteND - 12.02.2019, 14:16
Re: MySQL Insert ID - by ComDuck - 12.02.2019, 14:50

Forum Jump:


Users browsing this thread: 2 Guest(s)