how to get drop down data on id in sql server code in php code example
Example: drop down php form retrieve data from database
<!DOCTYPE html>
<html>
<head>
<title>PHP Retrieve Data from MySQL using Drop Down Menu</title>
</head>
<body>
<form>
City:
<select>
<option disabled selected>-- Select City --</option>
<?php
include "dbConn.php";
$records = mysqli_query($db, "SELECT city_name From tblcity");
while($data = mysqli_fetch_array($records))
{
echo "<option value='". $data['city_name'] ."'>" .$data['city_name'] ."</option>";
}
?>
</select>
</form>
<?php mysqli_close($db); ?>
</body>
</html>