Reputation: 4396
I'm subsequently inserting a single record in two tables. With the first insert i put the record in the main table, where the primary key value gets generated. Now i need to put some fields of this record in another table including the key value of the main table. How do i do this?
Upvotes: 4
Views: 156
Reputation: 2330
"SELECT LAST_INSERT_ID();
" will return the last autoincrement ID generated.
Upvotes: 3