title: Error: Unknown column 'Array' in 'where clause'
body: <p>I want update several row from database table with <code>foreach</code> but give following error:</p>
  
  <p>This is my php code:</p>
  
  <pre><code>$id_units       = $this-&gt;input-&gt;post('id_units');
  $name_un       = $this-&gt;input-&gt;post('name_units');      
  $price_un        = $this-&gt;input-&gt;post('price_units');
  $description_un = $this-&gt;input-&gt;post('explanation_units');
  $ex_un       = $this-&gt;input-&gt;post('addition_units');
  $service_un        = $this-&gt;input-&gt;post('checkbox_units');
  $data2 = array();
  foreach ($name_un as $idx =&gt; $name) {
      $data2 = array(
          'relation' =&gt; $id_residence,
          'name_un' =&gt; $name_un[$idx],
          'price_un' =&gt; $price_un[$idx],
          'description_un' =&gt; $description_un[$idx],
          'ex_un' =&gt; $ex_un[$idx],
          'service_un' =&gt; json_encode($service_un[$idx]), // This Is Line Number: 212
      );
  $this-&gt;db-&gt;update('hotel_units', $data2, array('id' =&gt; $id_units[$idx]));
  };
  </code></pre>
  
  <p>Above code have this error:</p>
  
  <blockquote>
    <p>A Database Error Occurred<br> Error Number: 1054<br> Unknown column
    'Array' in 'where clause'<br> UPDATE <code>hotel_units</code> SET <code>0</code> = Array
    WHERE <code>id</code> = Array<br> Filename:
    D:\xampp\htdocs\system\database\DB_driver.php<br> Line Number: 330<br></p>
  </blockquote>
  
  <p><strong>Update:</strong></p>
  
  <p>I have new error:</p>
  
  <blockquote>
    <p>A PHP Error was encountered<br> Severity: Notice<br> Message:
    Undefined offset: 1<br> Filename: residence.php<br> Line Number:
    212<br> <p> A PHP Error was encountered<br> Severity: Notice<br>
    Message: Undefined offset: 2<br> Filename: residence.php<br> Line
    Number: 212<br> <p> A PHP Error was encountered<br> Severity:
    Notice<br> Message: Undefined offset: 3<br> Filename:
    residence.php<br> Line Number: 212<br></p>
  </blockquote>
  
  <p><code>'service_un' =&gt;...</code> are checkbox. See Line Number: 212 in above php code</p>