Forum Moderators: open

Message Too Old, No Replies

mysql auto-increment start number

         

aditogs

2:50 pm on Dec 13, 2007 (gmt 0)

10+ Year Member



Hi,

Currently using internet to log feedback forms. These get placed into a Mysql file with an auto-incrementing id.

I then download these files (approx 1000 at a time) and clear the table.

The next time the table is filled, auto-increment starts at one again - not good given that each feedback needs to be logged with a unique code for reply-to etc.

Is there an easy way to get auto_increment to start from a set number (I can define each time if need be) or a way to drop all but the last record.

I export the table to excel.

Can anyone help?

jatar_k

2:53 pm on Dec 13, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



[dev.mysql.com...]

you can set it to the last id using an alter table after it is cleared

ALTER TABLE tbl AUTO_INCREMENT = 100;

just replace 100 with whatever the last id was +1