title: Cant update first product quantity in Codeigniter Cart
body: <p>I cant seem to update my first product quantity in my Cart on Codeigniter.</p>
  <p>Heres the cart.php code:</p>
  <pre><code>&lt;?php
  $cartdata = $this-&gt;cart-&gt;contents();
  foreach ($cartdata as $data):
      ?&gt;
      &lt;form method=&quot;POST&quot; action=&quot;&lt;?php echo base_url();?&gt;wholesaler/updatequantity/&quot;&gt;
  &lt;tr&gt;
      &lt;td class=&quot;product__thumbnail&quot;&gt;
          &lt;a href=&quot;#&quot;&gt;
              &lt;img src=&quot;&lt;?php echo base_url().'uploads/products/'.$data['image'];?&gt;&quot; alt=&quot;&quot;&gt;
          &lt;/a&gt;
      &lt;/td&gt;
      &lt;input class=&quot;form-control&quot; name=&quot;rowid&quot; value=&quot;&lt;?php echo $data['rowid'];?&gt;&quot; type=&quot;hidden&quot;&gt;
      &lt;td class=&quot;product__name&quot;&gt;
          &lt;a href=&quot;#&quot;&gt;&lt;?php echo $data['name']; ?&gt;&lt;/a&gt;
          &lt;br&gt;&lt;br&gt;
          &lt;small&gt;&lt;?php echo $data['sellername']; ?&gt;&lt;/small&gt;
      &lt;/td&gt;
      &lt;td class=&quot;product__price&quot;&gt;
          &lt;div class=&quot;price&quot;&gt;
              &lt;span class=&quot;new__price&quot;&gt;RWF &lt;?php echo $data['price']; ?&gt;&lt;/span&gt;
          &lt;/div&gt;
      &lt;/td&gt;          
      &lt;td class=&quot;product__quantity&quot;&gt;
          &lt;div class=&quot;input-counter&quot;&gt;
              &lt;div&gt;
                  &lt;span class=&quot;minus-btn&quot; id=&quot;decrease&quot; onclick=&quot;decreaseValue()&quot;&gt;
                      &lt;img src=&quot;https://img.icons8.com/android/24/000000/minus.png&quot;/&gt;
                  &lt;/span&gt;
                  &lt;input type=&quot;number&quot; id=&quot;number&quot; min=&quot;0&quot; name=&quot;qty&quot; placeholder=&quot;&lt;?php echo $data['qty'];?&gt;&quot; class=&quot;counter-btn&quot; /&gt;
                  
                  &lt;span class=&quot;plus-btn&quot; id=&quot;increase&quot; onclick=&quot;increaseValue()&quot;&gt;
                      &lt;img src=&quot;https://img.icons8.com/android/24/000000/plus.png&quot;/&gt;
                  &lt;/span&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/td&gt;
      &lt;td&gt;
      &lt;button type=&quot;submit&quot; class=&quot;btn btn-secondary btn-sm&quot;&gt;Update Quantity&lt;/button&gt;
      &lt;/td&gt;
      &lt;/form&gt;
      &lt;td class=&quot;product__subtotal&quot;&gt;
          &lt;div class=&quot;price&quot;&gt;
              &lt;span class=&quot;new__price&quot;&gt;RWF &lt;?php echo $data['subtotal']; ?&gt;&lt;/span&gt;
          &lt;/div&gt;
          &lt;a href=&quot;&lt;?php echo base_url().'wholesaler/deletecart/'.$data['rowid'];?&gt;&quot; class=&quot;remove__cart-item&quot;&gt;
              &lt;svg&gt;
              &lt;img src=&quot;https://img.icons8.com/ios-filled/24/000000/delete-forever.png&quot;/&gt;
              &lt;/svg&gt;
          &lt;/a&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  &lt;?php endforeach ;?&gt;
  </code></pre>
  <p>Here is my controller:</p>
  <pre><code>function updatequantity(){
      $data = array(
      'rowid' =&gt; $this-&gt;input-&gt;post('rowid'),
      'qty'   =&gt; $this-&gt;input-&gt;post('qty'),
      );
      $this-&gt;cart-&gt;update($data);  
      $this-&gt;load-&gt;view('wholesale/cart');
  }
  </code></pre>
  <p>So i can update for other products its just the first one, it even seems not to go to my update function when i press the update button.</p>
  <p>Please help out.<a href="https://i.stack.imgur.com/RjkTQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RjkTQ.png" alt="Here is a screenshot of my screen" /></a></p>