[thelist] SELECTing and auto_increment field

Bill Haenel bill at webmarketingworx.com
Thu Sep 13 18:22:53 CDT 2001

> Why not just add a column of the timestamp type.  It will automatically
> adjust the value any time the field is updated (or inserted).
> Then you just
> search for the most recent time.

Searching for the most recent time seemed a bit complicated in itself,
compared to the three lines I used to tap the lastedited table for the
last_id. field

To do that, wouldn't I have to check a row, save the timestamp, then check
the next row and compare the timestamp of it to the one in the last row,
until I've been through the entire table looking for the highest timestamp?

You may be right, but it seemed simpler to add an UPDATE along with each
INSERT operation, then check that one lastedited table which was about three
or four rows max.

Maybe I'm wrong?

More information about the thelist mailing list