Since I don't understand the usage at all, I'll take my best shot at this and would appreciate any help on corrections that need to be made.
I've altered the quantity boxes on my form to the following:
<input type='text' size='5' maxlength='5' name=\"product[$id]['qty']\">
foreach ($_POST['product'] as $id) {
$query="INSERT INTO products_ordered (order_id,product_id,quantity) VALUES ('$order_id','$id','$qty')";
$results=mysql_query($query) or die(mysql_error());
}
Even not understanding this at all, I can see that this is screwed up. Will $id and $qty already be defined by the foreach?