If the user is updating the password then you have to be very careful and need to set up some verification such as sending a user an email to the person. There has to be some information in the table that can verify the user is who he/she says that the are like the email address example I gave you. I am not understanding the part of password being empty? If the password is empty then how was the user account created in the first place? If you are just setting up a test account then simply update the password field by the id.
It sends a verification mail in case of password and mail changes. No problem here.
When editing user profile, When updating name, surname, and other information
If he’s not changing his password, That is, if leaving the password input fields blank and pressing the update button
Passwords in the database will not be updated, If she enters her new password in the password input fields, her password in the database will be changed.