Or add a "insert_date" column of type "timestamp" to the database. This will automatically store the time of insertion. Then use ORDER BY insert_date.


Edwin

Jason Sheets wrote:
You could create a integer column with an autoincrement flag, then order
the rows by this column, that should give you the data in the order it
was inserted into the db.  Depending on your database there are other
ways to do it.

Jason
On Sat, 2003-02-01 at 18:07, John W. Holmes wrote:

On Sat, 2003-02-01 at 17:25, John W. Holmes wrote:

I'm loading a .csv file into MySQL, done it a million times but

for

some

reason it is scrambling the row order. All the fields are making

it in

correctly but the order of the rows seems to end up totally

random.

I've

done this a million times and never saw this..
So?

Why does it matter to you what order the rows are in the database,

as

long as the right data is there? The order is irrelevant.

Because in this instance I need it to come out in the order it is
actually in.
Then use an ORDER BY in your query. If you're relying on the database to
spit out rows in the order they went in, then you're wrong.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to