<?php
include("config.php");
$sql = "SELECT DISTINCT(country) FROM regform";
$result = $conn->query($sql);
$sqlc = "SELECT DISTINCT(city) FROM regform";
$resultc = $conn->query($sqlc);
?>
<form method="GET" name="regform" action="searchadvance.php">
Mobile:<input type="text" name="mobile">
Country:<select name="country">
<?php
echo "<option value='select'>Select Country</option>";
while($row = $result->fetch_assoc()) {
echo "<option value=".$row['country'].">".$row['country']."</option>";
}
?>
</select>
City:<select name="city">
<?php
echo "<option value='select'>Select City</option>";
while($rowc = $resultc->fetch_assoc()) {
echo "<option value=".$rowc['city'].">".$rowc['city']."</option>";
}
?>
</select>
<input type="submit">
</form>
<?php
$conn->close();
?>