<?php 
include("dbcon.php");

$nameid = $_POST['datapost'];

$query = "select * from tbl_submenu where menu_id = $nameid";
 $result = mysqli_query($con,$query);
 ?>
<option>Select Sub Category</option>
 <?php
 
 while($row = mysqli_fetch_array($result)){?>
	
	 <option value="<?php echo $row['submenu_id'];?>"><?php echo $row['sub_menu'];?></option>
	 <?php
 }

?>