in reply to How do I find what column $dbh-{'insert_id'} was inserted into?
Immediately after the insert, execute a SELECT LAST_INSERT_ID() as if it were a normal select statement in DBI. The value you retreive will be the auto_increment column value of your recent insert.
This is covered in the DuBois book (pp. 93, 170, 547) and in the MySQL online docs under 'Miscellaneous Functions'.
(Note that mysql_insert_id() is part of the C API and is not directly accessable from Perl.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: How do I find what column $dbh-{'insert_id'} was inserted into?
by boo_radley (Parson) on Feb 14, 2001 at 18:35 UTC |