I have two tables:
table1- id, col1, col2, col3, col4, col5
id is an auto_increment.
table2- id, col1, col2, col3
In this, id is also Auto_increment and primary key on (col1,col2,col3).
My HTML form has some inputs; upon submit button click, I insert some inputs into table1
and the remaining inputs into table2
. But the ids of these do not match. How can I ensure that the id of each newly inserted record is the same between the tables?