Jump to content

Query Not Running


Hartley

Recommended Posts

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
Share on other sites

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.