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)