Conditional write of a field to database

Conditional write of a field to database

tchristforttchristfort Posts: 22Questions: 7Answers: 0

I have a table with user details. One of these are a password in md5 hash. When updating a user I need to only encrypt and write the password when a new password has been entered in the form. I can use the field->Set(false) to prevent write to the database, but can this be based on a condition: field value not empty? or should I go a total different way?

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,168Questions: 1Answers: 2,588
    Answer ✓

    Hi @tchristfort ,

    This earlier forum post is likely to help. It links to this blog post, which does give a solution similar to what you suggested.

    Cheers,

    Colin

  • tchristforttchristfort Posts: 22Questions: 7Answers: 0

    Perfect,

    Thank you Colin,

This discussion has been closed.