How would you do the same but this time fetch data from a mysql table then display it in a select form field and have the value stored in the model_in_city table as selected?
Here's what I have so far but every city is being displayed in its own dropdown menu.
Code:
<?php
include("../includes/connect.php");
$query = "SELECT * FROM city";
if ($result = $db->query($query)) {
while ($row = $result->fetch_assoc()) {
$name = $row['city_name'];
echo "<select name=\"select\">";
echo "<option>$name</option>";
echo "</select>";
}
$result->free();
}
$db->close();
?>