auto_increment and INSERT INTO

From: Date: Sun, 22 Jan 2006 04:38:12 +0000
Subject: auto_increment and INSERT INTO
Groups: php.db 
Request: Send a blank email to php-db+get-41110@lists.php.net to get a copy of this message
I have various tables where a column is set to auto_increment in my table structure. I have been using the following INSERT query format: INSERT INTO table VALUES ('$auto_increment_variable','$variable_1', '$variable_2') and then in applications where I have needed to know the value of the $auto_increment_variable I have immediately queried the table for $variable_1 and $variable_2 and used $reference = mysql_result($result,$i,"reference"); to determine what numeric value was assigned. Is there a way I may find out what value was assigned to the $auto_increment_variable when the INSERT INTO query is issued? Thanks. Ron

« previous php.db (#41110) next »