Welcome Guest, Not a member yet? Register   Sign In
Best practice for editing db data.
#1

My question is mainly for educational purposes, so..
What is the best practice for updating data in db only if they are not empty in form?

For example lets say i have a form in user's panel which contains his info (e.g. user email, name etc..)
The fields are fulfilled with parsing data in "value" attribute, but the password and some other fields are empty by default. 

What is the fastest way to pass them into an array only if they are not blank, in order not to change the already registered value in db?!

I hope my question is understandable.. if not, feel free to ask for clarification!

Thank you!!

//Life motto
if (sad() == true) {
     sad().stop();
     develop();
}
Reply


Messages In This Thread
Best practice for editing db data. - by HarrysR - 08-23-2018, 12:02 PM



Theme © iAndrew 2016 - Forum software by © MyBB