Hi all, just new to php.
To get to the point, I populate a dropdown menu from a database in MySQL. What I need to be able to do is when the user selects an item from the dropdown menu I want to display the cost of the item in a table next to the table contaning the drop down menu.
The code is here :
<?
mysql_select_db("ecafe");
$result = mysql_query("select * from bev_hot");
$options="";
while($r=mysql_fetch_array($result))
{
$item=$r["item"];
$options.="<OPTION VALUE=\"$item\">".$item.'</option>';
}
?>
<tr>
<td width=216>
<select name=products>
<option value=0>Choose a Hot Drink
<?=$options ?>
</option>
</select>
</td>
</form>
As you can see the dropdown list is populated from the "bev_hot" table in MySQL. In this table there is also a field called cost which is the cost of the item (in this case a hot drink)
What I need to do is once the user selects the beverage I need to display the cost of the drink in the table directly next to it.
The table fields that I need to access are "item" (Product Description) and "cost" (Cost of product)
Does this make any sense at all and if so is it at all possible???