Dropdown box from MySQL
Posted: Wed Feb 15, 2012 7:03 pm
Hi, I am trying to populate a drop down menu from MySQL, which lists all of the users in a database that haven't been approved, I then want a button next to this drop down which would then approve the user that is selected in the drop down.
The drop down is being populated with the correct information but I can't seem to figure out how to add the button next to the drop down and make it approve the selected user. This is what I have so far:
Thanks in advanced
The drop down is being populated with the correct information but I can't seem to figure out how to add the button next to the drop down and make it approve the selected user. This is what I have so far:
Code: Select all
$result = mysql_query("SELECT * FROM user WHERE approved = 'no'");
echo "<select name='approval'>";
while ($row = mysql_fetch_array($result)) {
echo "<option value='" . $row['username'] . "'>" . $row['username'] . "</option>";
}
echo "</select>";