A single HTML select tag is populated by a MySQL database table. When a user selects an option containing multiple words and submits it, only the first word of the selection is saved.
This is the code for the HTML form:
Transaction Type
Select type…
<?php
foreach ($rows as $row) {
echo "<option value = ". $row['type_name'] . ">" . $row['type_name'] . "</option>";
}
?>
</select>
<br><br>
<input type="submit" value="Submit" />