Skip to content
Advertisement

Edit user in DB change password only if password is changed. What I am missing here?

I am using PHP 8.x and an admin control panel, what I want to achieve is if I want to edit user1 and “Password” and “Confirm Password” fields are empty “password” row in DB should not be changed.

Bellow is the current PHP code that I am using but if “Password” and “Confirm Password” fields are empty row “password” in DB will be changed to “0” EMPTY and user would be able to login with an EMPTY password on login form.

code here:

JavaScript

Advertisement

Answer

Instead of doing

JavaScript

do this:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement