Inserting into Multiple tables
I'm collecting information from a web form that I want to post into 4 different tables. There are 4 parts of the web form, each part will submit information into a different table. Each table is related to the others by a similar key "user_id"
I would like to post all 4 parts of the web form data to each of their corresponding tables with a single INSERT statement. Is this possible?
example:
Instead of
INSERT INTO Table_1 (userName, userPhone, userEmail) Value('Bill', '555-5555','this@emial.com') WHERE userID = '54';
INSERT INTO Table_2 (userName, userCompany, userCompanyPhone) Value('Bill', 'Big Bucks LLC', '555-5555') WHERE userID = '54';
INSERT INTO Table_3 (userName, userCar, userVIN) Value('Bill', 'Toyota','212342342342332') WHERE userID = '54';
INSERT INTO Table_4 (userName, userCellPhone, userHours) Value('Bill', '555-5555',9) WHERE userID = '54';
Can i just do one big insert like:
INSERT
INTO Table_1 (userName, userPhone, userEmail) Value('Bill', '555-5555','this@emial.com')
INTO Table_2 (userName, userCompany, userCompanyPhone) Value('Bill', 'Big Bucks LLC', '555-5555')
INTO Table_3 (userName, userCar, userVIN) Value('Bill', 'Toyota','212342342342332')
INTO Table_4 (userName, userCellPhone, userHours) Value('Bill', '555-5555',9)
WHERE userID = '54';
(I thought it would be better to do that then to seperated the query and run it 4 seperate times)
Thanks ahead of time!