getting results from INSERT

From: Date: Fri, 26 Oct 2001 11:57:04 +0000
Subject: getting results from INSERT
Groups: php.db 
Request: Send a blank email to php-db+get-13747@lists.php.net to get a copy of this message
What i'm after is getting the primary key for a record that's just been added - I have an image file upload accompanying a database addition, and the image gets renamed $unique_ID.jpeg only problem is that the current method inserts the information, which auto produces the primary key, but the only way i know to extract that is by doing a SELECT, searching for all the matching values to the ones just entered, and if two entries are the same(except for the primary key - which is unknown), the image will replace the earlier entry, rather than the one i actually want it to be for. Is there a way of returning this primary key immediately after that record is created?

« previous php.db (#13747) next »