stelthius Posted July 15, 2009 Share Posted July 15, 2009 Alright guys im back again, sorry! for some reason my form isnt updating the DB but it is printing out done as it normally would do once updating the DB any suggestions or ideas guys ? $newpass = $_POST['forcednewpass']; } if($_POST['form'] == "userid"){ $userid = $_POST['userid']; $password = md5($newpass); mysql_query("UPDATE users SET password='$password', flag='0' WHERE username='$userid'") or die(mysql_error()); print"done"; } Link to comment https://forums.phpfreaks.com/topic/166091-solved-form-not-updating-the-db/ Share on other sites More sharing options...
ronnie88 Posted July 15, 2009 Share Posted July 15, 2009 try not using this: if($_POST['form'] == "userid"){ and see what happens. Link to comment https://forums.phpfreaks.com/topic/166091-solved-form-not-updating-the-db/#findComment-875940 Share on other sites More sharing options...
Noumes Posted July 15, 2009 Share Posted July 15, 2009 could you do something like if(isset($_POST['submit'])) { $userid = $_POST['userid']; $password = md5($newpass); mysql_query("UPDATE users SET password='$password', flag='0' WHERE username='$userid'") or die(mysql_error()); print"done"; } Link to comment https://forums.phpfreaks.com/topic/166091-solved-form-not-updating-the-db/#findComment-875941 Share on other sites More sharing options...
stelthius Posted July 15, 2009 Author Share Posted July 15, 2009 Alright after some fiddling im still not getting it to work here is my code... $query="SELECT username FROM vs_users WHERE password = '$new_pass'"; $newpass = $_POST['forcednewpass']; $newpassconf = $_POST['forcednewpass1']; if(!$newpass == $newpassconf){ printf("<script>location.href='login.php?op=nopwmatch'</script>"); } if($_POST['form'] == "userid"){ $userid = $_POST['userid']; $password = md5($newpass); mysql_query("UPDATE vs_users SET password='$password', flag='0' WHERE username='$userid'") or die(mysql_error()); printf("<script>location.href='login.php'</script>"); } } Any help is appretiated i think im just missing something simple! Link to comment https://forums.phpfreaks.com/topic/166091-solved-form-not-updating-the-db/#findComment-876039 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.