<?php
include('connect.php');
error_reporting(0);

if(isset($_POST["statemid"]) && !empty($_POST["statemid"])){
    //Get all state data
   
$statemid = $_POST['statemid'];

$eve="SELECT * FROM res_city_master WHERE statemid= ".$statemid;

    $re = mysqli_query($conn, $eve);
//echo '<option value="'.$eve.'">'.$eve.'</option>';
    //Count total number of rows
    if(mysqli_num_rows($re) > 0)
{
echo '<option value="0">Select City</option>';
        while($rt = mysqli_fetch_assoc($re)){
            echo '<option value="'.$rt['citymid'].'">'.$rt['cityname'].'</option>';

        }
    }else{
        echo '<option value="0">No Data Found</option>';
    }
}
?>