Getting the auto increment value of the row inserted ??

From: Date: Mon, 08 Jan 2001 19:21:54 +0000
Subject: Getting the auto increment value of the row inserted ??
Groups: php.windows 
Request: Send a blank email to php-windows+get-4872@lists.php.net to get a copy of this message
Hi I am using PHP4 and mySQL. I have a table in mySQL with an auto increment column as the primary key. When I do an insert from the PHP page, I need to return the inserted record's primary key. Currently after inserting the record I am immediatly doing a "select max(pk) from tablename" to fetch the value. Is there any better solution for this. Many thanks -Mujahid

« previous php.windows (#4872) next »