splitting <SELECT> drop down values
hi guys
Sorry for posting a question that has undoubtedly been answered many times before... I'm just a bit stuck trying to figure it out.
I have a <SELECT> list, which brings in values from the database - the option name and the price ($row_rstGetOptions)
http://www.rtmedia.co.uk/test/davidhayward/product_Details.php?product_ID=22
I can get the name to bind to $ATC_itemName, but can't get the price to bind to $ATC_itemPrice as the price comes from the same <SELECT> list...
Here's my relevant code, thanks for all your help:
$ATC_itemID = $_POST["eCart1_1_ID_Add"];
$ATC_AddIfIn = 2;
$ATC_RedirectAfter = "cart.php";
$ATC_RedirectIfIn = "";
if (isset($totalRows_rstProduct) && $totalRows_rstProduct > 0) {
$row_rstProduct = WAEC_findRecordMySQL($rstProduct, "product_ID", $ATC_itemID);
if ($row_rstProduct) {
$ATC_itemName = "".$row_rstProduct['name'] ." - ". $row_rstGetOptions['option'] . "";// column binding
$ATC_itemDescription = "";// column binding
$ATC_itemThumbnail = "";// column binding
$ATC_itemWeight = floatval("0");// column binding
$ATC_itemQuantity = "".$_POST["eCart1_1_Quantity_Add"] ."";// column binding
$ATC_itemPrice = "".$_POST["eCart1_1_Price_Add"] ."";// column binding
<select name="eCart1_1_Price_Add">
<?php
do {
?>
<option value="<?php echo $row_rstGetOptions['price']?>"><?php echo $row_rstGetOptions['option']?></option>
<?php
} while ($row_rstGetOptions = mysql_fetch_assoc($rstGetOptions));
$rows = mysql_num_rows($rstGetOptions);
if($rows > 0) {
mysql_data_seek($rstGetOptions, 0);
$row_rstGetOptions = mysql_fetch_assoc($rstGetOptions);
}
?>
</select>