Hi I would like to echo result of the price of the menu. Below are the code but nothing is display after I select a menu type such as menu 1.
<select name="updateMenuPrice" class="StyleTextField" id="updateMenuPrice">
<option value="-1">Select One</option>
<option value="Menu 1">Menu 1</option>
<option value="Menu 2">Menu 2</option>
<option value="Menu 3">Menu 3</option>
</select>
<?php
if(isset($_POST['UpdatePriceBtn'])){
$_SESSION["cupdateprice"] = $_POST['updateMenuPrice'];
}
$con = mysqli_connect("localhost", "root", "password", "test") or die(mysql_error());
if (!$con) {
die('Could not connect: ' . mysql_error());
echo 'fail1
';
}//if
// else echo 'Connected successfully';
$sql = "SELECT Price from menu where Menu_type = '".$_SESSION["cupdateprice"]."'";
if(mysqli_query($con, $sql)){
$result = mysqli_query($con, $sql);
echo $sql ;
}
else {
echo "failed";
}
?>