title: CodeIgniter activerecord, retrieve last insert id?
body: <p>Are there any options to get the last insert id of a new record in CodeIgniter?</p>
  
  <pre><code>$last_id = $this-&gt;db-&gt;insert('tablename',
      array('firstcolumn' =&gt; 'value',
      'secondcolumn' =&gt; 'value')
  );
  </code></pre>
  
  <p>Considering the table consits of fields id (autoincrement) firstcolumn and secondcolumn.</p>
  
  <p>This way you can use the insert id in the following code.</p>