Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to update record in Codelgniter

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 108
    Comment on it

    Hello Friends

    If you are looking to update records in Codelgniter. Please follow the code for the same:

    // Define the array with your db attribute as key and your updated data as value 
    $data = array(
            'country_name' => $countryName,
            'country_flag' =>  $flagName,
            'status' => '1'
            );
    
    // Define where condition as below and replace this with your values, In the update pass your database table in the place of country and $data with your values and attributes 
    $this->db->where(array('id' => $id))->update('country', $data);
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: