View Full Version : pulling auto increment value

03-14-2007, 10:59 PM

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?

03-15-2007, 12: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