title: update_batch in codeigniter
body: <p>Here is my code that i used to update all the rows that am getting for that i used update_batch function but its not working properly</p>
  
  <pre><code> public function edit_project_involved($users)
  {
  
      foreach ($users as $v_user) {
  
      $data=array('involved'=&gt;1);
      $v=$this-&gt;db-&gt;where('user_id',$v_user);
      $query=$this-&gt;db-&gt;update_batch('tbl_users',$data,$v);
      }
  
      if($query)
      {
          return true;
      }
  
  }
  </code></pre>
  
  <p>my $users var_dump looks like this</p>
  
  <pre><code>C:\wamp64\www\spectra\application\models\Project_model.php:536:
  array (size=3)
  0 =&gt; string '40' (length=2)
  1 =&gt; string '42' (length=2)
  2 =&gt; string '37' (length=2)
  </code></pre>
  
  <p>am getting an error like this </p>
  
  <pre><code>One or more rows submitted for batch updating is missing the specified index.
  </code></pre>
  
  <p>Filename: C:/wamp64/www/spectra/system/database/DB_query_builder.php</p>
  
  <p>Line Number: 2010</p>
  
  <p>My table looks like this</p>
  
  <pre><code>user_id     username        involved
      1         admin           0
      36        siraj           0
      37        faizal          0
      38        nesru           0
      40        jaseer          0
      42        maltu           0
      43        shahul          0     
      44        samsheera       0
  </code></pre>
  
  <p>var_dump($data) looks like this</p>
  
  <pre><code>C:\wamp64\www\spectra\application\models\Project_model.php:544:
  array (size=3)
  0 =&gt; 
    array (size=2)
      'user_id' =&gt; string '40' (length=2)
      'involved' =&gt; int 1
  1 =&gt; 
    array (size=2)
      'user_id' =&gt; string '42' (length=2)
      'involved' =&gt; int 1
  2 =&gt; 
    array (size=2)
      'user_id' =&gt; string '37' (length=2)
      'involved' =&gt; int 1
  </code></pre>