Re: Re: Getting last record ID created from DB

From: Date: Sat, 17 Mar 2007 18:18:39 +0000
Subject: Re: Re: Getting last record ID created from DB
References: 1 2 3 4 5 6 7 8  Groups: php.general 
Request: Send a blank email to php-general+get-250763@lists.php.net to get a copy of this message
----- Original Message ----- From: <markw@mohawksoft.com>
There in lies the biggest problem with LAMP, and that's MySQL. The architecture of your methodology *only* works with MySQL, and not more capable databases like Oracle, DB2, or even PostgreSQL. If you rely on oddities of a particular system, then you are doomed to be stuck with it or pay the price of redesign when you need a more capable system.
Not so much. Most databases offer some sort of autoincrementing integer and a means to get its value immediately after an insert. The syntax both for creating it and retrieving it might vary, but it exists in some form or other. This does not excuse the overuse of autonumerics as primary keys and most often, the only key in a whole table. Significant keys, that is, keys that are meaningful for the data being stored, are far more valuable if they exist. Satyam

« previous php.general (#250763) next »