I keep getting this error everytime I execute the following code. My problem child is this line.
$result2 = mysql_query($q_6,$conn_new_4) or die (mysql_error ());
I am populating another database with the following information that is passed through via a form from a script with a diffrent database. Everything is going good until I hit this error message.
My 2 cents
- I do not think that I have passed in the id correctly.
- Changed original mysql_db_query to mysql_query on the problem line and still no joy.
Can it be that I am reusing the same connection for the second result set. By the way can you tell I am kind of new at this🙂 I am learning but at the moment I need help. Can someone take a look at the following code and tell me if they see something wrong.
Thanks
$conn_new_3=mysql_connect("localhost", "xxx", "xxx");
$q_3="insert into silly_user(user_created,user_updated,user_nickname,user_password,user_emailadr,user_temp) values('".$id."','".$t."','".$t."','".$login."','".$pswd_1."','.$email.','".$pswd."')";
$user_id = mysql_insert_id();
$q_4="insert into silly_user (user_id) values('".$user_id."')";
$db_new_3=mysql_select_db("db2",$conn_new_3) or die("db cant open");
mysql_close($conn_new_3);
$conn_new_4=mysql_connect("localhost", "xxx", "xxx");
$q_5="select * from play_band_info a, silly_user b Where a.band_name = b.user_nickname";
$result = mysql_db_query("db2",$q_5,$conn_new_4) or die (mysql_error());
while ($row = mysql_fetch_assoc($result)) {
$q_6 = "update silly_user set user_band_id = '".$row['band_id']."' where user_nickname = '".$row['band_name']."'";
$result2 = mysql_query($q_6,$conn_new_4) or die (mysql_error ());
mysql_close($conn_new_4);