Help for this page
$dbh->do("LOCK TABLES tbl WRITE"); $dbh->do("INSERT INTO tbl VALUES(NULL,'foo','bar')"); my $ref = $dbh->selectcol_arrayref(" SELECT LAST_INSERT_ID() FROM tbl"); $dbh->do("UNLOCK TABLES");
DATABASE HANDLES The DBD::mysql driver supports the following attributes of database ha ... +te is not valid for DBD::mSQL. An alternative way for accessing this +a +ttribute is via $dbh->{'mysql_insertid'}. (Note we are using the $dbh + +in this case!)