MySQL Forums
Forum List  »  Newbie

Re: Triggers on two tables to get Primary Keys (Auto Increment) into third linking table
Posted by: Barry Galbraith
Date: February 22, 2016 03:08PM

INSERT into one table, the issue SELECT LAST_INSERT_ID() to get the id of the inserted row.
then INSERT into the other table, and do the same again to get id from that table.
Then insert those 2 ids into your linking table.

Good luck,
Barry.

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.