jumpenjuhosaphat Posted April 4, 2007 Share Posted April 4, 2007 I'm getting this error: Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/homeswap/public_html/admin_profile.php on line 97 This is the output of my query: UPDATE user SET password='########' , first='David' , last='Davis' , address='#### Gull St.' , town='####' , county='#####' , postarea='ZE3' , postcode='ZE3 J83L' , phone='###-###-5868' , email='jumpenjuhosaphat@####.com' WHERE username='jumpenjuhosaphat' I hashed out the personal stuff for obvious reasons. Here is the code, can you spot any troubles? $sql=sprintf("UPDATE user SET password='%s' , first='%s' , last='%s' , address='%s' , town='%s' , county='%s' , postarea='%s' , postcode='%s' , phone='%s' , email='%s' WHERE username='%s'", $pass1, $first, $last, $address, $town, $county, $postarea, $postcode, $phone, $email, $username); if(!mysql_query($sql, $con)) { die($sql.mysql_error()); } Quote Link to comment https://forums.phpfreaks.com/topic/45556-solved-mysql-error-i-cant-figure-it-out/ Share on other sites More sharing options...
jumpenjuhosaphat Posted April 4, 2007 Author Share Posted April 4, 2007 This seems to be how it works everytime. I search and search the internet for a solution, and search and search my code to try to find the problem. Then as a last resort, I bring the trouble here..... As soon as I do that, I figure it out....The problem was in this line: if(!mysql_query($sql, $con)) I took out the $con variable, and now it works fine.... Quote Link to comment https://forums.phpfreaks.com/topic/45556-solved-mysql-error-i-cant-figure-it-out/#findComment-221182 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.