The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

INSERT INTO country values(1,"Afghanistan","AF");
INSERT INTO country values(2,"Brazil","BR");
... down to 300 or something

Would that work the same? If it does, obviously it's easier putting NULL instead as it will ensure that u dont have any errors in numbering and it will automatically do the work for u... right? (I think!).

INSERT INTO country values(1,"Afghanistan","AF");
INSERT INTO country values(2,"Brazil","BR");
... down to 300 or something

Why not let the ID auto-increment like it is designed to do instead of entering values for it? If you specify the column names as part of the insert command you should be able to skip the ID column. It should look like this:

Originally posted by haironfireWhy not let the ID auto-increment like it is designed to do instead of entering values for it?

yeah, it's designed to auto increment if you want it to! dumps always have an AUTO_INCREMENT column's values explicitly in the dump file. you certainly DO NOT want the numbers to be generated for you with existing data! if numbers were deleted, they will get reused when renumbered sequentially. if you had references to a certain id in another table, which you most likely did, guess what? it will be pointing to the wrong thing now.

since these AUTO_INCREMENT columns usually serve as the PRIMARY KEY, its values should stay the same. there's a good chance that won't happen if you "let the ID auto-increment like it is designed to do..."

- Matt ** Ignore old signature for now... **
Dr.BB - Highly optimized to be 2-3x faster than the "Big 3." "Do not enclose numeric values in quotes -- that is very non-standard and will only work on MySQL." - MattR

Originally posted by DR_LaRRY_PEpPeR since these AUTO_INCREMENT columns usually serve as the PRIMARY KEY, its values should stay the same. there's a good chance that won't happen if you "let the ID auto-increment like it is designed to do..."

Thanks for the heads up.
I thought he was trying to insert fresh data, not a dump so it seems like it should be OK.

I am pretty new at this, but could you do the following:

1. create a new database in mysql.
2. compile the list of NAME, ISO values as a text file with each entry enclosed by quotes and a open / close paren around a whole line.