title: How to update specific field in CodeIgniter update?
body: <p>I'm using <code>CodeIgniter</code> framework for the <code>easyappointments.org</code> library. I'm trying to update the field <code>data</code> through the id of a row. Actually this is my code for the update:</p>
  
  <pre><code>return  $this-&gt;db
                  -&gt;update('ea_appointments', $appointment)
                  -&gt;where('ea_appointments.id', $appointment_id);
  </code></pre>
  
  <p>The problem's that the <code>update</code> method need two parameter (table to update, associative array with the fields name column of db). In my above function I pass only the <code>$appointment_id</code>, so the variable <code>$appointment</code> is empty and doesn't contain any associative array. I want to know how to update only the field <code>data</code> to <code>1</code>. And remain the other field in the same value condition.
  This is the structure of the table:</p>
  
  <pre><code>id|book|start|end|notes|hash|unavailable|provider|data
  </code></pre>
  
  <p><strong>Logic example:</strong></p>
  
  <p>previous condition row:</p>
  
  <pre><code>id =&gt; 0
  book =&gt; example
  start =&gt; 18/10/2015
  end =&gt; 19/10/2015 
  notes =&gt; empty
  hash =&gt; akdjasldja
  unavailable =&gt; false
  provider =&gt; 5
  data =&gt; 0 
  </code></pre>
  
  <p>I pass in the function <code>$appointment_id</code> with 0 value. I'm waiting this new result:</p>
  
  <pre><code>id =&gt; 0
  book =&gt; example
  start =&gt; 18/10/2015
  end =&gt; 19/10/2015 
  notes =&gt; empty
  hash =&gt; akdjasldja
  unavailable =&gt; false
  provider =&gt; 5
  data =&gt; 1
  </code></pre>
  
  <p>So the main problem is retrieve first the all field value of the specific row and later update? Or something like this. Could someone help me?</p>