grabbing id from new record

From: Date: Mon, 14 Jan 2002 14:23:59 +0000
Subject: grabbing id from new record
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-15768@lists.php.net to get a copy of this message
Hi, Is there a way to grab the ID (from ID field) while INSERTing a new record? I am currently doing a separate INSERT then a SELECT query to find the most recently added record by that user: select ID from table where user = '$user' order by ID DESC limit 0,1 This does the trick but it may not be the most efficient way. George --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01 _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com

« previous php.db (#15768) next »