MySQL: how to use the result of one INSERT in another INSERT

I need to use the received key of one insert, in another insert. Is this possible with MySQL?

+3
source share
1 answer

mysql_insert_id returns the id of the last inserted record, you can use this

Gets the identifier generated for the AUTO_INCREMENT column by the previous request (usually INSERT).

+3
source

All Articles