I have two tables called ‘USER’ and ‘CART’ the two tables contain the same column name ‘USER_ID’.
If I am to insert a new ‘USER_ID’ into the ‘USER’ table, how can I make this ‘USER_ID’ be in the ‘CART’ table as well? Using only one command:
INSERT INTO USER (USER_ID) VALUES ('1');
Is there an easy way to do this ?
Tanya, I guess it’s not possible to insert into two tables with one query in mysql. You may find your question discussed/answered in the below link.
sql – insert into multiple tables in one query