<?php
require_once "dbconnection.php";
$country_id = $_POST["country_id"];
$result = mysqli_query($con,"SELECT * FROM states where country_id = $country_id");
?>
<option value="">İl Seçiniz</option>
<?php
while($row = mysqli_fetch_array($result)) {
?>
<option value="<?php echo $row["id"];?>"><?php echo $row["name"];?></option>
<?php
}
?>