Auto generate code in php codeigniter
<p>I'm trying to create a SKU code for my database. What I need to do is increment the last value code in my column name <code>division_code</code>. My last example code in my column is like this 'DIV343'. When I add a new data, I need to increment the last value into DIV344, but what I'm getting in my column is '1'.</p>

<p>Any help will appreciate.</p>

<pre><code>public function save($data)
{
    $data = array(
        'division_name'     =&gt; $data['division_name'],
        //'division_code'       =&gt; $data['division_code'],
        'division_acro'     =&gt; $data['division_acro']
        );
    $this-&gt;db-&gt;set('division_code', '`division_code`+ 1', FALSE);
    $this-&gt;db-&gt;insert($this-&gt;table, $data);
    return $this-&gt;db-&gt;insert_id();

}
</code></pre>