mysql insert statement multiple rows code example
Example 1: mysql best way to insert many rows
INSERT INTO table_name(id,colname) values(1,"row 1"),(2, "row 2"),...;
Example 2: 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;