I have a problem with batch updates
hypothetically I am a loop printing out the box and product ID
while($row = mysqli_fetch_array($data)){
<input type="hidden" name="cart_prod_id[]" value="<?=$row["prod_id"];?>">
<input type="hidden" name="cart_quantity[]" value="<?=$row["quan"];?>">
}
I want to modify the product information of a certain table
this is what it prints out by default:
quantity of ID/ for goods
12 / 2
13 / 1
14 / 5
when I want to change the number of one of the items, I will change 13 to 10
how to write the code received by my other party?
to update the database
I know this is the database:
foreach ...
"UPDATE `user_cart`
SET `quan` = {$quan}
WHERE `prod_id` = "{$prod_id}" "
but how do I get every prod_id and quan? How to match?
prod_id = 12, quan = "2"
prod_id = 13, quan = "10"
prod_id = 14, quan = "5"
I am too weak to upload this batch. I received
more forgiveness for the first time