Click to See Complete Forum and Search --> : get auto-inc ID while doing insert


dataline
09-11-2008, 03:30 PM
Hi,

Doing some PHP/MySQL. Quick question. I tried looking through the forum but couldn't find the answer.

I have a table with 2 fields: an auto-inc ID and a name. When I add a name (after making sure it doesn't already exist in the table), is there anyway I can get the ID without querying the table after the insert. Is this possible?

Thanks

DL

dataline
09-11-2008, 03:41 PM
never mind. found the answer at

http://www.plus2net.com/sql_tutorial/mysql_insert_id.php