Pandareen Posted December 30, 2011 Share Posted December 30, 2011 Hello!Is this correct? $sql="INSERT INTO pacienti (nume, prenume, cnp, varsta, sex, casa_asigurari, oras, strada, numar, judet, data_inregistrarii) VALUES ('$_POST[nume]','$_POST[prenume]','$_POST[CNP]','$_POST[varsta]','$_POST[sex]','$_POST[casa]','$_POST[oras]','$_POST[strada]','$_POST[nr]','$_POST[judet]','$_POST[internare]')"; $sql="INSERT INTO diagnostic (nume) VALUES ('$_POST[diagnostic]')"; and i mean..if i can do 2 insert in 2 different tables...or how can i do this? Quote Link to comment https://forums.phpfreaks.com/topic/254070-insert-x2/ Share on other sites More sharing options...
Muddy_Funster Posted December 30, 2011 Share Posted December 30, 2011 That's the standard way of doing it. just remember to execute each query before you overwrite the $sql variable with the next one. Quote Link to comment https://forums.phpfreaks.com/topic/254070-insert-x2/#findComment-1302484 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.