adchico Posted October 10, 2007 Share Posted October 10, 2007 this is my code $query = mysql_query("UPDATE registration SET Fname = '$fname' AND MI = '$MI' AND Lname ='$Lname' WHERE username= '$user'"); echo $query; if($query){ echo "Thank you $user, your record has been updated sucessfully! <a href= 'index.php?section=User_account'> Back </a>" ; }else{ echo "There has been an error. ".mysql_error(); } Output is ok: 1 Thank you Mario, your record has been updated sucessfully! BACK but when you look in the database it is not really updated! Quote Link to comment Share on other sites More sharing options...
anujgarg Posted October 10, 2007 Share Posted October 10, 2007 it seems that no value is coming in your $user variable...try to print the query and check if it shows the desired values Quote Link to comment Share on other sites More sharing options...
adchico Posted October 10, 2007 Author Share Posted October 10, 2007 I already echoed out the result of the query it opted 1 what does it mean? Quote Link to comment Share on other sites More sharing options...
anujgarg Posted October 10, 2007 Share Posted October 10, 2007 have you printed out the whole query? I mean to say just put 'echo' in front of your query statement and have a look at it in the browser and then execute that query into MySQL Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted October 10, 2007 Share Posted October 10, 2007 $query = mysql_query ("UPDATE registration SET Fname = $fname AND MI = $MIAND Lname =$Lname WHERE username= $user"); that should work the single quotes are messing it up since it is already parsed in double quotes Quote Link to comment 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.