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

Personally I query the DB for that user profile to get a $user object.
And then I do something like this:
PHP Code:
// Do your validation here or in form_validation.
if( !empty($this->input->post('address') ) {
 
   $user->address $this->input->post('address');

After that I do an update query to the DB. And it "replaces" everything again with new and old data.
Reply


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



Theme © iAndrew 2016 - Forum software by © MyBB