What is the best way to populate records in two tables that each need a reference to the primary key of the other?
My thoughts are either having a "link" table between them which is populated once both have been written to the db or by the following complex series of commands
Insert1
get identity1
Insert2
get identity2
update 1
How would you do this in PHP whilst connected to a mySQL Database and maintain integrity?
Would you need to use transactions, if so how would you go about doing this?