I am using paypal to process payments on my site. Paypal returns the post array like
[item_number1] =12
[item_name1] = My product name
[quantity1] =3
[item_number2] =14
[item_name2] = My product name2
[quantity2] =5
[num_cart_items] 2
Insert step here now im just going in circles getting nowhere
And then run the for loop
for($i = 1;$i <= $num_cart_items ;$i++){
$x = 'item_number' . $i;
$y = 'item_name' . $i;
$z = 'quantity' . $i;
$new_amount = $row['stock_quantity'] - $$z;
$db->update1_by_match('cart_products','stock_quantity',$new_amount,'id',$$x);
}
Im having trouble with these variable variables. Is there a better way to do this?
Thanks Andrew