Re: Pear DB LastInsertID
| From: | Martin Tsachev | Date: | Wed, 10 Jul 2002 00:10:59 +0000 |
| Subject: | Re: Pear DB LastInsertID | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-1831@lists.php.net to get a copy of this message | ||
LIMBOURG Arnaud wrote:
have a look at nextID() in common.php, it does exactly what you want.Nope it doesn't exaclty do that, sequences are *emulated* for some backends like MySQL for example, and MySQL has auto_increment which is faster, although one shouldn't use PEAR::DB if he/she wants the best performance. Comparing PHP to C is useless, so if it's not implemented just do it the PEAR way. Having twice the tables you need is somewhat confusing and useless to me though.
Regards,-- Martin Tsachev Web developer http://members.evolt.org/shaggy/How about putting a new function into the MySQL Driver for PEAR DB, some thing like getLastInsertedId(). IMHO using the native functions from the DB is more efficient then implamating a layer to emulate the beharvior of others DBs. []s