Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

mysql insert into multiple tables

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;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #mysql #insert #multiple #tables
ADD COMMENT
Topic
Name
7+9 =