title: A Database Error Occurred Error Number: 1054 Unknown column... in 'field list'
body: <p>I can't get my head round this...</p>
  
  <p>Controller:</p>
  
  <pre><code>public function update()
  {
      $string = 'xml/gzip';
      $xml    = simplexml_load_file("compress.zlib://$string");
      foreach ($xml-&gt;merchant as $merchant) {
          $merchant_name = $merchant['name'];
          $merchant_id = $merchant['id'];
          $data1          = array(
                'merchant_id' =&gt; $merchant_id,
                'merchant_name' =&gt; $merchant_name
          );
          $this-&gt;load-&gt;model('Administration_model');
          $this-&gt;Administration_model-&gt;insert_merchants($data1);
      }
  }
  </code></pre>
  
  <p>Model:</p>
  
  <pre><code>public function insert_merchants($data1)
  {
      $this-&gt;db-&gt;insert('merchants', $data1);
  }
  </code></pre>
  
  <p>The <code>foreach</code> loop in my controller is running data from an xml spreadsheet, and as the error says - the values '911' and 'website.com' SHOULD be the inserted values... So why is it determining 'website.com' as a 'field list'?</p>
  
  <p>Error:</p>
  
  <pre><code>A Database Error Occurred
  
  Error Number: 1054
  
  Unknown column 'website.com' in 'field list'
  
  INSERT INTO `merchants` (`merchant_id`, `merchant_name`) VALUES (911, website.com)
  </code></pre>
  
  <p>Would it have anything to do with the fact that <code>merchant_id</code> is a primary column and this is technically a duplicate entry... And if so, any tips on how to add "ON DUPLICATE KEY..." functionality?</p>