Look into the mysql_insert_id function, that looks like what you want.

On Feb 24, 2004, at 12:02 PM, David Scott wrote:

Hi list peeps....
In many of my projects I have the need to insert a new record into a table and then later on in the script update this record, Right now I am doing this by doing the insert, then immediately doing a Select to return the latest id (unique id) which I store later for my update.


Is there any way I can do an insert and have it return the unique auto-assigned id?

Cheers
Dave
--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to