Kyle123 Posted February 8, 2012 Share Posted February 8, 2012 if(isset($_POST['npassword']) and ($_POST['cpassword'])){ $npassword = $_POST['npassword']; $cpassword = $_POST['cpassword']; $username = $_SESSION['SESS_login']; if($npassword==$cpassword){ $password = md5($npassword); $lol = mysql_query("UPDATE `members` SET `passwd` = '$password' WHERE `login`= '$username';"); echo"Password Changed!"; } } It echos password changed, but its not updating the password. If I run it in phpmyadmin it works fine... So i'm really stuck. Link to comment https://forums.phpfreaks.com/topic/256686-mysql-update/ Share on other sites More sharing options...
Maq Posted February 8, 2012 Share Posted February 8, 2012 Standard debugging - echo out your query and add or die() to your mysql_query call: $query = "UPDATE `members` SET `passwd` = '$password' WHERE `login`= '$username'"; echo "Query: " . $query; $lol = mysql_query($query) or die(mysql_error()); Link to comment https://forums.phpfreaks.com/topic/256686-mysql-update/#findComment-1315894 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.