Codeigniter : Updating multiple cart items
<p>I am working with Codeigniter shopping cart. I want to update multiple cart items. this is what i'm doing  </p>

<pre><code>public function updatecart(){

    foreach ($this-&gt;input-&gt;post() as $value){
        $this-&gt;cart-&gt;update(array(
            'rowid'      =&gt;     $value['rowid'],
            'qty'        =&gt;     $value['qty'],
        ));
    }
    redirect(base_url().'product/cart');
}
</code></pre>

<p>This code updates only first item in cart instead of updating all the items , need your help to fix it, if I do  <code>print_r($this-&gt;input-&gt;post());</code> this is what I get . </p>

<pre><code>Array
(
    [1] =&gt; Array
        (
            [rowid] =&gt; ad61ab143223efbc24c7d2583be69251
            [qty] =&gt; 7
        )

    [2] =&gt; Array
        (
            [rowid] =&gt; d09bf41544a3365a46c9077ebb5e35c3
            [qty] =&gt; 1
        )

)
</code></pre>

<p>and when i update it only updates qty index for first array index </p>