Stuart Gall wrote:
>
> On 23 Mar 2006, at 18:24, Greg Sabino Mullane wrote:
>
>>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>>
>>> I am using DBI Version 1.42 on OSX, accessing a MySQL database on
>> ...
>>
>> The last_insert_id() method was broken prior to 1.43, so at the very
>> least, you should install a newer version of DBI.
>
> Good Call, I have upgraded to 1.50, but alas *still* only
> $dbh->{'mysql_insertid'} works.
I've never been able to get it working with MySQL either ( tried many
different DBI & DBD::mysql versions ). If you want something a *little*
more portable than $dbh->{'mysql_insertid'}, then you can use:
select @@IDENTITY
... which SQL Server ( and maybe even others ) understands as well.
Dan