darkfreaks Posted June 15, 2008 Share Posted June 15, 2008 <?php mysql_query("UPDATE users SET username = '$euser', email = '$eemail', avatar = '$eavatar', currency = '$ecurrency' WHERE username = '".$_SESSION['usere']."'");?> Quote Link to comment Share on other sites More sharing options...
Nexy Posted June 15, 2008 Author Share Posted June 15, 2008 What did you change? Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted June 15, 2008 Share Posted June 15, 2008 nothing just removed the htmpspecialchar syntax what was that AND? ??? Quote Link to comment Share on other sites More sharing options...
Nexy Posted June 15, 2008 Author Share Posted June 15, 2008 I don't understand you. The query works perfectly fine as I have it. Problem is some members don't get updated for some reason. Quote Link to comment Share on other sites More sharing options...
sasa Posted June 15, 2008 Share Posted June 15, 2008 in your 1st post you have mysql_query("UPDATE users SET username = '$euser' WHERE username = '".$user['username']."'"); mysql_query("UPDATE users SET email = '$eemail' WHERE username = '".$user['username']."'"); if($erank == "member") { mysql_query("UPDATE users SET rank = '2' WHERE username = '".$user['username']."'"); } else if($erank == "moderator") { mysql_query("UPDATE users SET rank = '3' WHERE username = '".$user['username']."'"); } else if($erank == "gmod") { mysql_query("UPDATE users SET rank = '4' WHERE username = '".$user['username']."'"); } else if($erank == "admin") { mysql_query("UPDATE users SET rank = '5' WHERE username = '".$user['username']."'"); } mysql_query("UPDATE users SET avatar = '$eavatar' WHERE username = '".$user['username']."'"); mysql_query("UPDATE users SET currency = '$ecurrency' WHERE username = '".$user['username']."'"); in 1st query you change value in field username and another query can't find right row Quote Link to comment Share on other sites More sharing options...
Nexy Posted June 15, 2008 Author Share Posted June 15, 2008 Not sure I follow you. The query you posted wasn't working, so I changed it to this: <?php if($_POST['esubmit'] && !empty($euser) && !empty($eemail) && !empty($erank) && !empty($eavatar) && !empty($ecurrency)) { if($erank == "member") { mysql_query("UPDATE users SET rank ='2' WHERE username = '".$_SESSION['usere']."'"); } else if($erank == "moderator"){ mysql_query("UPDATE users SET rank ='3' WHERE username ='".$_SESSION['usere']."'"); } else if($erank == "gmod") { mysql_query("UPDATE users SET rank ='4' WHERE username = '".$_SESSION['usere']."'"); } else if($erank == "admin") { mysql_query("UPDATE users SET rank ='5' WHERE username = '".$_SESSION['usere']."'"); } mysql_query("UPDATE users SET username = '$euser', email = '$eemail', avatar = '$eavatar', currency = '$ecurrency' WHERE username = '".$_SESSION['usere']."'"); echo "<div class='create' style='width: 400px; text-align: center; padding: .6em'> <img src='images/update.png' alt='' /> " . $_SESSION['usere'] . ' has been updated.</div>'; unset($_SESSION['usere']); } ?> This works just fine. The problem is some members update and others don't. I don't receive the "User has been updated" for some of the members. 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.