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? 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') 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. 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. Link to comment https://forums.phpfreaks.com/topic/253819-insert-into-2-tables/#findComment-1301248 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.