...

View Full Version : pulling auto increment value



rschoenbach
03-14-2007, 11:59 PM
hello.

I am using this query to put data into my tables. The null value is an auto_incremented column.


$query = 'insert into round_info values (null,'.$course_id.',1,'.$gross_score.');

Is there a code that allows me to pull the value that it automatically increments without doing another query?

guelphdad
03-15-2007, 01:25 AM
Yes, last_insert_id, see this article (http://www.guelphdad.wefixtech.co.uk/sqlhelp/lastinsertid.shtml) for information on managing inserts into secondary tables.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum