You are modifying every row in the table because of you have not given any specific row. And for this reason every row is updated after update code runs. you should use below code
function update_data($id = FALSE)
{
if($id == FALSE){
$query = $this->db->get('user');
return $query->result_array();
}
$query = $this->db->get_where('user', array('id' => $id));
return $query->row_array();
}
public function update_user_data($data)
{
$data = array('firstname' => $this->input->post('firstname'),
'lastname' => $this->input->post('lastname'),
'fullname' => $this->input->post('fullname')
);
$this->db->where('id','1')->update("user", $data); //change id as require your own need
}