Re: DB, MDB2, PDO - Future of DB-Abstraction in PEAR

From: Date: Thu, 04 Aug 2005 08:33:03 +0000
Subject: Re: DB, MDB2, PDO - Future of DB-Abstraction in PEAR
References: 1 2 3 4  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-39200@lists.php.net to get a copy of this message
Lukas Smith wrote:
I'm not 100% sure how to implement it with PDO::lastInsertId(). An application should not know which database is used and which features are supported. Do all PDO-Drivers support:
http://de.php.net/manual/en/function.pdo-lastinsertid.php Notice that you can optionally pass in a string. If you do pass in a string on an RDBMS that does not natively support last insert id it will actually try to get the current ID from a sequence with that name. this is currently only implemented in the PostGreSQL driver and effectively means you can use a SERIAL column just like an auto increment column in MySQL.
And what happends if I pass a string to PDO::lastInsertId() when I use any database except postgresql? Will they behave in the same way as when passing no string? regards, Andreas

« previous php.pear.dev (#39200) next »