How can I fetch the last row that was inserted using DBI (DBD::mysql)?
Code sample:
my $sth = $dbh->prepare(\'INSERT INTO a ( x, y, z ) VALUES ( ?
SELECT LAST_INSERT_ID() query will also return what you want.
SELECT LAST_INSERT_ID()