Possible Duplicate:
mySQL return index after insert
Hy,
Is there a way that after inserting something in mysql database (INSERT INTO table_name VALUES () ...) to retrieve ID of that insert for further manipulation ?
The old way is to make the insert and then query a SELECT on the table name . But is there any way to do this in a single query ?
Thank you very much
In PHP, call
mysql_insert_id(). Or directly in MySQL, call theLAST_INSERT_ID()function.