views:

13

answers:

1

I'm trying to import my CSV data file back into my database in the same order it is in the CSv file. However when I import the order is all jumbled from how it appears in the file.

Is there a way to force PHPmyadmin to import in the exact same order as the CSV?

A: 

SQL databases don't have an order by default. If you want ordering, provide a column to sort on, then use this column in ORDER BY in your queries.

For your situation, you could look at making an autoincrement primary key. This key will increment with your import and then be suitable for your requirements.

Habbie
Okey but a CSV of only 216 items goes into the DB in the same order as I have in my CSV file. But when I do the CSV with 547 items it is jumbled order in the table.
Mark
Yes. "It depends". Use ORDER BY.
Habbie