CodeIgniter inserting auto increment
<p>I'm doing a basic add user form for work and I'm trying to add a user to the database however when I try I just get the primary key is being duplicated error. Pretty sure the solution is looking me right in the face but I've hit a wall today lol.</p>

<p>database table struture</p>

<p>dbo.ci_users</p>

<pre><code>id(PK, int, not null)
user_name(nchar255, not null)
user_email(nchar255, not null)
user_password(nchar255, not null)
user_displayname(nchar255, not null)
user_active(smallint, not null)
user_level(smallint, not null)
</code></pre>

<p>Adduser_model</p>

<pre><code>&lt;?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class adduser_database extends CI_Model {

         function __construct()
        {
            // Call the Model constructor
            parent::__construct();
            $this-&gt;load-&gt;database();
        }

    public function insert_into_db()
    {
        $data = array(
            'id'            =&gt; '0',
            'user_active'        =&gt; '1',
            'user_level'         =&gt; '2',
            'user_displayname'   =&gt; $this-&gt;input-&gt;post('user_displayname'),
            'user_email'         =&gt; $this-&gt;input-&gt;post('user_email'),
            'user_name'      =&gt; $this-&gt;input-&gt;post('user_name'),
            'user_password'      =&gt; $this-&gt;input-&gt;post('user_password') 
        );

        $this-&gt;db-&gt;insert('ci_users', $data);

    }
}
</code></pre>