title: How would I use ON DUPLICATE KEY UPDATE in my CodeIgniter model?
body: <p>I have a CodeIgniter/PHP Model and I want to insert some data into the database.</p>
  
  <p>However, I have this set in my 'raw' SQL query:</p>
  
  <pre><code>ON DUPLICATE KEY UPDATE duplicate=duplicate+1
  </code></pre>
  
  <p>I am using CodeIgniter and am converting all my previous in-controller SQL queries to <strong>ActiveRecord</strong>. Is there any way to do this from within the ActiveRecord-based model?</p>
  
  <p>Thanks!</p>
  
  <p>Jack</p>