title: I need to update multiple rows of data with different values. which php loop or code i can use to implement the same?
body: <p>I need to update multiple rows of data with different values. which php loop or code i can use to implement the same?</p>
  
  <p>here is the code which am using.</p>
  
  <pre><code>for ( $i = 0 ; $i &lt; count ( $_POST ['productname'] ) ; $i++ )  
  {  
      $qry2 = "UPDATE invoice_transaction 
                  SET inv_trans_item_qty='".$_POST['quantity'][$i].
                  "',inv_trans_created_by='".$act_admin.
                  "',inv_trans_created_on='".$date.
                  "' WHERE inv_code='".$inv_code."'";
  
      $res2 = mysqli_query($cn,$qry2);
  }
  </code></pre>