Hi all:
I am totally lost from the start and could use some help/direction regarding an array.
I have a dynamically generated form. The form has 4 values; prID, product, price and quantity. All values are filled in directly from the database with the exception of quantity. Below is code (with incorrect attempts at name values...):
<?php
$query = "SELECT pdID, product, price, detailLink, discount FROM cartProducts WHERE productGroup='Banners'";
$result = mysqli_query($link, $query);
while($row = mysqli_fetch_array($result, MYSQLI_ASSOC)){
$vDiscountedListingPrice = $row["price"]-$vDiscountListings;
echo "<tr>\r\n";
echo "<td style='font-weight:bold; width:60%; text-align:left;'>".$row["product"]."";
if ($vDiscount == "Y"){
echo ": <span style='color:green;'>Regular Price: $".$row["price"]."</span>: <a style='font-weight:normal;' href='itm/shp".$row["detailLink"].".php'>See Details</a></td>\r\n";
}
echo "<td style='font-weight:bold; width:20%; text-align:right;'>Quantity <input type='text' name='".$row["pdID"]."|[quantity]' value='0' size='1'></td>\r\n";
echo "<td class='redletter' style='font-weight:bold; width:10%; text-align:right;'>$".$vDiscountedListingPrice."</td>\r\n";
echo "<input type='hidden' name='".$row["pdID"]."|[product]' value='".$row["product"]."'>\r\n";
echo "<input type='hidden' name='".$row["pdID"]."|[price]' value='".$vDiscountedListingPrice."'>\r\n";
echo "<input type='hidden' name='pdID' value='".$row["pdID"]."'>\r\n";
echo "</tr>\r\n";
}
mysqli_free_result($result);
?>
I am posting this data to a page so I can insert it into a database. I cannot figure out how to set up the array to bring over the product/price/quantity so it is associated with the prID (product ID). My goal is to insert a record showing product/price/quantity/prID.
Maybe I am tired, but I have read tizag, the PHP manual and other Google articles, but I cannot figure this out. The biggest sticking point is the quantity. That is not being generated by the database but by the user so I do not see where I include that with the other 3 array values.
Any help/guidance is appreciated!