I am testing a password update process with php/mysql. I don't get any error on submit, but my values are not updated. Any ideas?
if (!empty($_POST['password']) && !empty($_POST['password2'])){
$id = $_GET['id'];
$password = md5(mysql_real_escape_string($_POST['password']));
$sql = mysql_query("UPDATE users SET `Password` = '$password' WHERE UserID = '$id'");
if ($sql){
echo $password, $id;
}else{
echo mysql_error();
}
}
echo $pw, $idat all?$_GETand$_POST. Is this deliberate, or should$_GET['id']be$_POST['id']instead?$query = "UPDATE users SET Password = '$password' WHERE UserID = '$id'"and debug $query variable and check if it will work in your backend.