in reply to MySQL: INSERT and return?

I use DBI's last_insert_id() method. If you're using a new enough DBD, it's there.

Replies are listed 'Best First'.
Re^2: MySQL: INSERT and return?
by initself (Monk) on Apr 10, 2007 at 18:52 UTC
    Maybe I'm not using a new enough dbd for MySQL. I had to resort to 'mysql_insertid'.
    my $sth = $dbh->prepare($sql) $sth->{mysql_insertid};