General SQL how to question

Hi this is general how to question and does not really pertain to any particular language.

To keep it simple let’s say you have a page with a list of customer’s names. You click on the user to edit the user. A new page loads with text fields containing all the user’s information such as first, last, email, address, etc.

Let’s say I update the email address, when you click update what is the normal procedure SQL wise? Since you don’t know what fields were changed do you run the UPDATE query on all fields even though not all fields may have been updated? Maybe you have an array with all fields and their values and then compare what has changed and then only update that one value? Sorry for the ignorance but I have never understood how this scenario would be handled.


It depends on whether you have a separate update form for each field or just the one form to update multiple fields at the same time. If you use the more usual single form with multiple fields then all of those fields HAVE been updated when the form is submitted even if their new value is the same as the old value that was there before.