in reply to database not in correct order

I don't understand what order you want to see them in in the database. You are inserting them into the table with a post time of 0:0:0, so what is the primary key in the chat table? If the post time is stored in your DB_File implementation, I would suggest keeping it and making it part of the key to each entry in the chat table. Otherwise, DBMS's typically sort (on queries) based on the primary key, so if you have one defined, that's the order they probably come back in from your select. YOu can also use the SQL ORDER BY statement to get a sort order other than the primary key as well.

---
echo S 1 [ Y V U | perl -ane 'print reverse map { $_ = chr(ord($_)-1) } @F;'
Warning: Any code posted by tuxz0r is untested, unless otherwise stated, and is used at your own risk.

Replies are listed 'Best First'.
Re^2: database not in correct order
by Anonymous Monk on Nov 27, 2007 at 03:03 UTC
    The sort is done by the primary key ID. The time is entered in as 0:0:0 because I originally didn't store time in my original DB_File database but I'm going to start recording it now.

      The sort is done by the primary key ID.

      Assuming that you created the table with

      ... id int auto_increment, primary key (id), ...

      and you don't specify an ORDER BY clause for something other than id, you should get the records back in the order you put them in.

      Is it possible you forgot the auto_increment?