Hi guys i just want to be able to add this form to a mysql update command
E.g.
mysql_query("UPDATE table SET product_quantity = ‘.$product_count.’ WHERE product_id = ‘.$product_id.’ ");
for each array.
I done some test below just to see how it is processed… i need it to add like… Q then P then Q then P.
Im not sure how to do it, i tried adding two foreach commands inside each other although that came up with 3 times the results.
I was trying to add two foreach in one statement so i could reference to both at the same time.
All help would be great.
Thanks!
Q:13
Q:1
Q:1
Q:12
P:3
P:5
P:1
P:4
[php]include_once(‘content/page_header.php’);
//POST VARS
$quantity_post = $_POST[‘quantity’];
$product_post = $_POST[‘product_id’];
$string = “”;
foreach($quantity_post as $quantity){
$string .= “Q:”.$quantity."
";
}
foreach($product_post as $product){
$string .= “P:”.$product."
";
}
echo $string;
[/php]