Jump to content

Only submitting password update if filled in...


ShootingBlanks

Recommended Posts

Hello - this may be very easy, but I'm new at PHP...

 

I am building a page that a logged-in user can see their profile info, and then change/update things if they'd like.  I have everything pulling in properly, but I am intentionally not pulling in their password (that field comes up blank on their "update profile" screen)...

 

I want it so that if there is something filled into the password field, then the SQL query will update the "pwd" field in the database table (along with the rest of the fields for that record).  But, if they leave the password field blank (say, they just want to change their last name or something) then the SQL query will ignore the "pwd" field and only update the rest of the fields in that user's record in the table (thereby keeping the user's password the same as it was before they updated their record)...

 

The password is sha1-encrypted, otherwise I'd just pull the pwd from the database first...

 

I hope I'm making sense and someone can help.  Thanks!!!

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.