Jochen Wiedmann wrote:
On Mi, 2004-06-16 at 01:39, Daniel Kasak wrote:
Any if I use the suggested:
$pk = $dbh->{'mysql_insertid');
then I'm locking the object to work with MySQL only, and I'd really
prefer to use DBI's more portable 'last_insert_id()' function ... if the
damned thing works.
Do you think that SELECT LAST_INSERT_ID() is different in that aspect?
:-)
Huh?
DBI's database handle's last_insert_id() *function* is server neutral.
Have a look an the man page for DBI. The docs say specifically that it
works with MySQL, Postgres, Oracle, Informix, Sybase & SQL Server. So in
this way, I think the last_insert_id() function is quite different to both:
select LAST_INSERT_ID(), and
$dbh->{'mysql_insertid');
which both are MySQL-specific.