Note that last_insert_id has quite a few caveats including:
For some drivers the value may only be available if placeholders have not been used (e.g., Sybase, MS SQL). In this case the value returned would be from the last non-placeholder insert statement.
For this reason I prefer to get the database do provide the information rather than the driver.
my ($_cinsert) = $dbh->selectrow_array("SELECT LAST_INSERT_ID()");
In reply to Re: last_insert_id did not work
by Bod
in thread last_insert_id did not work
by bizactuator
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |