RE: [PHP-DB] get the record id of the last addition in a table

From: Date: Tue, 27 Nov 2001 09:00:14 +0000
Subject: RE: [PHP-DB] get the record id of the last addition in a table
Groups: php.db 
Request: Send a blank email to php-db+get-14587@lists.php.net to get a copy of this message
$last_add = mysql_insert_id(); - thanks to Bruno Gimenes Pereti who answered this very same question when i asked it a couple of weeks ago ;) all the best, Matt -----Original Message----- From: LeTortorec, Jean-Louis [mailto:JLeTortorec@healthcore.com] Sent: 26 November 2001 22:22 To: 'php-db@lists.php.net' Subject: [PHP-DB] get the record id of the last addition in a table Hi: I've created a table. The fields are "id" (auto-increment, integer), "field1","field2),... When I do "insert into mytable (field1..) values (...)", how to get in return the value of "id"? Thanks Jean-Louis --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01

« previous php.db (#14587) next »