title: codeigniter database error occurred when updating record
body: <p>i have an error </p>
  
  <pre><code>Error Number: 1054
  
  Unknown column 'Nama_Material_Jasa' in 'field list'
  
  UPDATE `ms_material_jasa` SET `Kode_Kategori_Material_Jasa` = 'KKMJ004', `Nama_Material_Jasa` = 'batuasdf' WHERE `Kode_Kategori_Material_Jasa` = 'KKMJ004'
  
  Filename: C:\wamp\www\QBA\system\database\DB_driver.php
  
  Line Number: 330
  </code></pre>
  
  <p>and this is my update model</p>
  
  <pre><code>function update($getid,$getnama)
  {
      $data = array('Kode_Kategori_Material_Jasa' =&gt; $getid,'Nama_Material_Jasa' =&gt; $getnama);
      $this-&gt;db-&gt;where('Kode_Kategori_Material_Jasa', $getid);
      $this-&gt;db-&gt;update('ms_material_jasa', $data); 
  }
  </code></pre>
  
  <p>and here is my controller </p>
  
  <pre><code> function ubah()
  {
      $getid = $this-&gt;input-&gt;post('kkmj');
      $getnama = $this-&gt;input-&gt;post('nmj');
      $data['pesan'] = $getid.' berhasil diubah ! ';
      $data['title'] = 'QB Ubah Kategori Material';
  
      $this-&gt;m_kategorimaterial-&gt;update($getid,$getnama);
      //echo $getid.$getnama; //it returns KKMJ005newVal , like i want
  
      $this-&gt;load-&gt;view('head',$data);
      $this-&gt;load-&gt;view('v/vkategorimaterial',$data);
  
  }
  </code></pre>
  
  <p>when i echo <code>$getid</code> and <code>$getnama</code> variable, it returns <code>KKMJ005Newval</code> so no problem on controller, i believe it has something to do with the models, </p>
  
  <p>how do i resolve this ?</p>
  
  <p>the table name is <code>ms_kategori_material</code> and it has 2 field, <code>Kode_Kategori_Material_Jasa</code> and <code>Nama_Material_Jasa</code></p>