harkly Posted December 11, 2009 Share Posted December 11, 2009 I want to be able to insert my userID into multiple tables at one time if possible. I thought I could do separate insert statements but its not working. Can someone point me in the right direction. $sql = "INSERT INTO user (userID, pswd, email, first_name, last_name, gender, bd_day, bd_month, bd_year, birth_date, street, city, state, zip, signup_date) VALUES ('$_POST[userID]','$_POST[pswd]','$_POST[email]','$_POST[first_name]','$_POST[last_name]', '$_POST[gender]','$_POST[bd_day]','$_POST[bd_month]','$_POST[bd_year]','$_POST[birth_date]','$_POST[street]', '$_POST[city]','$_POST[state]','$_POST[zip]','$_POST[signup_date]')"; $aboutMe = "INSERT INTO about_me (userID) VALUES ('$_POST[userID]')"; $pets = "INSERT INTO pets (userID) VALUES ('$_POST[userID]')"; $appearance = "INSERT INTO appearance (userID) VALUES ('$_POST[userID]')"; Link to comment https://forums.phpfreaks.com/topic/184713-insert-into-multiple-tables/ Share on other sites More sharing options...
fenway Posted December 11, 2009 Share Posted December 11, 2009 Of course you can run multiple statements. Link to comment https://forums.phpfreaks.com/topic/184713-insert-into-multiple-tables/#findComment-975165 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.