mattichu Posted December 25, 2011 Share Posted December 25, 2011 $con = mysql_connect("localhost","****","****"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("checkmyw_database", $con); mysql_query("INSERT INTO requests (username, password, email, weavecode, mobile, jobtitle, relationship, sexuality, venue, type) VALUES ('$me', '$pw', '$email','1999','$mobile','$job','$relationship','$sexuality','$venue','newuser')"); mysql_query("INSERT INTO members (username, password, email, weavecode, mobile, jobtitle, relationship, sexuality,) VALUES ('$me', '$pw', '$email','1999','$mobile','$job','$relationship','$sexuality',)"); mysql_close($con); any idea why this doesn't work? Quote Link to comment https://forums.phpfreaks.com/topic/253819-insert-into-2-tables/ Share on other sites More sharing options...
mattichu Posted December 25, 2011 Author Share Posted December 25, 2011 (there are no errors it just doesnt insert into the 2nd table 'members') Quote Link to comment https://forums.phpfreaks.com/topic/253819-insert-into-2-tables/#findComment-1301245 Share on other sites More sharing options...
SergeiSS Posted December 25, 2011 Share Posted December 25, 2011 Change ',)' in the second query to ')'. At the end of query. Quote Link to comment https://forums.phpfreaks.com/topic/253819-insert-into-2-tables/#findComment-1301246 Share on other sites More sharing options...
SergeiSS Posted December 25, 2011 Share Posted December 25, 2011 BTW... Why do you insert the same info into 2 different tables? It's not normal. Quote Link to comment https://forums.phpfreaks.com/topic/253819-insert-into-2-tables/#findComment-1301248 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.