Answers for "how to insert data into two table at a same time in mysql"

SQL
0

how to insert same table data using mysql query

Use INSERT ... SELECT:

insert into your_table (c1, c2, ...)
select c1, c2, ...
from your_table
where id = 1
Posted by: Guest on March-30-2021
0

insert data into multiple tables mysql

BEGIN;
INSERT INTO users (username, password)
  VALUES('test', 'test');
INSERT INTO profiles (userid, bio, homepage) 
  VALUES(LAST_INSERT_ID(),'Hello world!', 'http://www.stackoverflow.com');
COMMIT;
Posted by: Guest on July-03-2020

Code answers related to "how to insert data into two table at a same time in mysql"

Code answers related to "SQL"

Browse Popular Code Answers by Language