At 5:35 PM -0800 2000-01-12, jim@work wrote:
ok, i'm sure i have missed this in previous discussions, and it
seems so elemetary (uh, ya) that i must have overlooked it in the
manual (albeit, it's huge).
when i insert a record into the database from PERL (using DBI), that
has an auto-increment primary key, how do i got about getting that
primary key value??
In SQL:
SELECT LAST_INSERT_ID()
In DBI:
$dbh->{mysql_insert_id}
In PHP:
mysql_insert_id()
Of course, you can use the SQL statement in either DBI or PHP, too.