title: How to update a pirtucular column in a database?
body: <pre><code>    $credit = $this-&gt;db-&gt;select('credits');
      $this-&gt;db-&gt;from('users');
      $this-&gt;db-&gt;where('refferal_code',$refferal_code);
      $data1 = array('credits'=&gt;$credit + 10);
      $this-&gt;db-&gt;update('users',$data1);
  </code></pre>
  
  <p>I need to update a column in a database..
  When a user signs up, he will give a referral code.
  I need to check whether that code exists in the database and need to update the referral code for the user by giving him with 10 more credits.
  The above code shows error, Can anyone help me me figure why?</p>