hi,
am new to php. Have managed to display the contents of a table called menuitems from mysql into a dropdown. Next i need to change the label value based on the dropdown value selected. For eg. if the menuItem is selected from the dropdown i need the corresponding price to be displayed in the label. Am not sure how to do this as the label has no value attribute. Please advise
[php]
<? @ $db = mysql_pconnect("localhost","root","administrator"); if (!$db) { echo "Error: Could not connect to database. Please try again later."; exit; } mysql_select_db("orders"); $query = "select * from menuitems "; $result = mysql_query($query); $num_results = mysql_num_rows($result); for($i=0; $i < $num_results; $i++) { $row = mysql_fetch_array($result); echo "".$row["itemPrice"].""; } echo ""; ?>[/php]