I want to populate the above tag with values from database.
I have written php code up to t
You can see whats available to use by doing this in the while:
var_dump($result);
exit;
That will print the first result and its array contents. Then you can see what field you want to use to populate the option. From there, you would do something like:
foreach ($result['field'] as $field) {
print '<option value="'.$field.'">$field</option>';
}
Of course this is a very basic example, and as others have noted you may want to clean the data before putting it into a form.