Hartley Posted July 10, 2007 Share Posted July 10, 2007 I have a setup script to setup member accounts, and for some reason, it won't run multiple queries for me. $conn1 = mysql_connect($dbhost1, $dbuser1, $dbpass1) or die ('Error connecting to mysql'); mysql_select_db($dbname1); mysql_query("INSERT INTO user (forumid, username, joindate) VALUES ('$forumid', '$username', '$joindate')") or die(mysql_error()); mysql_query("INSERT INTO attunement (forumid) VALUES ('$forumid')") or die(mysql_error()); mysql_close($conn1); The first one runs just fine, but the second one doesn't at all and I simply can't figure out why. Link to comment https://forums.phpfreaks.com/topic/59254-query-not-running/ Share on other sites More sharing options...
trq Posted July 10, 2007 Share Posted July 10, 2007 Are you getting an error? Where are all these ($forumid, $username, $joindate) variables being defined? Link to comment https://forums.phpfreaks.com/topic/59254-query-not-running/#findComment-294287 Share on other sites More sharing options...
Hartley Posted July 10, 2007 Author Share Posted July 10, 2007 Getting no error, it runs just fine, just doesn't do the second part. The variables are all defined earlier in the script ($forumid based off of the cookies, the other 2 based off of forum information taken from the $forumid). Link to comment https://forums.phpfreaks.com/topic/59254-query-not-running/#findComment-294302 Share on other sites More sharing options...
shamilton Posted July 10, 2007 Share Posted July 10, 2007 Have you tried hard coding the values in? How about swapping the order of the queries? Are you sure you have error messages turned on? Try checking the state of the query and echoing out some random text to see if it is even getting to the second one. Link to comment https://forums.phpfreaks.com/topic/59254-query-not-running/#findComment-294306 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.