[email]JMosey[/email] wrote:Before (multi-)posting, try to read some of the answers already given in> I have a table, this table has an autonumber as a primary key.
> I export the table in phpMyAdmin.
> Cool so far.
> I create a new DB, I import the backup of the DB in that new DB and it
> throws an error that the table with the automnumber already has a
> value of 1 (it isn't incrementing the new table).
> Ok, go back and hack through, remove the autonumber. Now export and it
> imports fine.
> Except how do I get the autonumber back? There are hundreds of rows of
> data and I want that autonumber but when I try and add it it says
> there is already an ID field with a "1" (same as before, not saying
> "find the highest and add one more" just saying "start at 1, oops
> there is one, then die"
> Anyone know a way around this? I want to add my autonumber to my table
> with the data that is already there.
- Add AUTO_INCREMENT value
- Complete inserts
Should take car of the problem if you start with a clean table.
If for some reason, you can't gat this to work (and you should), you could
ALTER TABLE tbl AUTO_INCREMENT = next_integer_you_want;