I would appreciate some help in this matter as im probably going about it all wrong. The goal is to create a drop down menu which is populated from a table in a database and parse the selected item to $POST. The table has one column which is a list of locations. ie Brighton, Warwick, Stockholm etc.
Using a while loop:
Code: Select all
<select name="Location">
<?php
while ($row = mysql_fetch_array($locationresult, MYSQL_NUM)) {
printf("<option> %s </option>", $row[0]);
}
?>
</select>I thought something like
Code: Select all
while ($row = mysql_fetch_array($locationresult, MYSQL_NUM)) {
printf("<option value = %s> %s", $row[0], $row[0]);
}This project is for a local charity i have chosen to devote some time to and the system will (eventually) enable select members to mass email contacts by searching the database by location/group.
Any pointers would be greatly appreciated.