Welcome Guest, Not a member yet? Register   Sign In
[SOLVED] Stop Row ID From Changing
#1

[eluser]riwakawd[/eluser]
On my model is there away to stop db insert from creating a new row.

Each time it does and creates a new row id. I am only wanting to update the value but for some reason when I use update it does not change it.

Code:
<?php

class Model_setting extends CI_Model {

public function editSetting($group, $data) {

  foreach ($data as $key => $value) {
   $data = array(
          'group' =>$group,
          'key' => $key,
          'value' => $value
       );
  $this->db->insert('setting', $data);
  }
}

public function editSettingValue($group = '', $key = '', $value = '') {
  $data = array(
         'group' =>$group,
         'key' => $key,
         'value' => $value
      );
  $this->db->update('setting', $data);
}

}




Theme © iAndrew 2016 - Forum software by © MyBB