[phplib] MySQL/DB_Sql - LAST_INSERT_ID() From: Carl S. Yestrau Jr. (cyestrau <email protected>)
Date: 08/25/00

Currently the sign up process on the application I'm working on Inserts
data into two primary tables, namely the 'user' table and and an
associated weak entity table (composite key) to avoid a many to many
relationship. As one of the primary keys in the weak entity is the
newly generated primary key from MySQL's last autonumber sequence it
would be nice to retrieve that variable from the original SQL Insert
statement through the use of the LAST_INSERT_ID() function. My primary
concern however is that the LAST_INSERT_ID function may mistakenly
retrieve another primary key value due to a more recent insert from the
persistent connections in DB_Sql.

The documentation on LAST_INSERT_ID on the MySQL web site was minimal at
best and any tips on how to use the function within an SQL statement and
get an error free result would be greatly appreciated.

Thanks Dudes,
Carl

---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>