Re: Pear DB LastInsertID

From: Date: Wed, 10 Jul 2002 06:59:45 +0000
Subject: Re: Pear DB LastInsertID
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-1834@lists.php.net to get a copy of this message
At 03:10 10/07/02 +0300, Martin Tsachev wrote:
        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.
The best way IMO would be to change the nextID function to take two parameters: table_name and col_name. It would be up to the end user to create a sequence on the table column (in databases that supported it) - and for databases that don't the driver class could behave as they do at the moment, creating another table and updating the number in the column. Peter --oOo-- Narrow Gauge on the web - photos, directory and forums! http://www.narrow-gauge.co.uk --oOo-- Glenbranter - Scottish narrow gauge in 009 http://glenbranter.narrow-gauge.co.uk --oOo--

« previous php.pear.general (#1834) next »