php - While loop won't work with Paypal -


i trying make user can add multiple products paypal checkout. name="item_name_1" in paypal form has increment 1 added cart. thought of adding 1 variable ( $number) every time while loop reaches end, isn't working.

while loop

//for paypal order number $number = 0;  while($row = oci_fetch_assoc($runquery)) {        $number =  $number + 1;      $prodid = $row['product_id'];     $price = $row['price'];     $image = $row['imageid'];     $prodname = $row['name'];     $stallname = $row['stall_name'];     $quantity = $row['productquantity'];     $day = $row['day'];     $time = $row['time_choice'];     $total = $row['totalprice'];      $subtotal = $price * $quantity;      echo '   <tbody>           <tr>';      echo  '<td> <img src="' . $image . '" height="50" width="50"/></td>';     echo  '<td>' . $prodname . '</td>';     echo '<td>' . $stallname . '</td>';     echo  '<td> ' . $quantity . '</td>';          echo  '<td>&pound;' . $price . '</td>';      echo  '<td>&pound;' . $subtotal . '</td>';             echo'     </tr>';      //increments number paypal orders     echo'     </tbody>    <thead>       <tr>         <th>clear order</th>         <th></th>         <th>collection day</th>         <th>collection time</th>         <th>total</th>         <th>pay</th>       </tr>     </thead>     <tbody>       <td><form method="post" action="clearorder.php"><input type="submit" name="clearorder" value="clear" /></form></td>       <td></td>';     echo '<td>' .$day . '</td>';     echo '<td>' .$time . '</td>';     echo '<td>&pound;' .$total . '</td>';       echo'  paypal form          <form action="https://www.paypal.com/uk/cgi-bin/webscr" method="post">           <td> <input type="hidden" name="cmd" value="_cart"> <input type="hidden" name="business" value="email"';     echo '<input type="hidden" name="item_name_' . $number . '" value="' . $prodname . '">';     echo'<input type="hidden" name="quantity_' . $number . '" value="' . $quantity . '">';     echo '<input type="hidden" name="amount_' . $number . ' value="' . $price . '">';     echo '<input type="hidden" name="currency_code" value="gbp">';      echo '<input type="hidden" name="upload" value="1">'; } } ?> 


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -