I saving user info with the following code:
$hashed = password_hash($password, PASSWORD_DEFAULT);
Then followed by my insert query which look like this:
INSERT INTO users (username, password) VALUES ('$username', '$hashed');
When I retrieve the password with normal select statement and pass the value of the password to an input type of password, the textbox will have the password in hashed form. Then I make changes just to the username and update with:
UPDATE users SET username = '$username', password = '$hashed' WHERE id = 1;
The already hashed password is re-hashed thereby bringing a change to the original password. This causes users not able to log in. Any help?