Title: admin dynamic sleect box
Last modified: August 20, 2016

---

# admin dynamic sleect box

 *  [craigcmurray](https://wordpress.org/support/users/craigcmurray/)
 * (@craigcmurray)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/admin-dynamic-sleect-box/)
 * ok…relatively new to wordpres plugin development…and php dev for that matter.
   making a little since of this stuff tho…
 * not having any luck with getting a <select box to populate from values in a table…
   any help would be greatly appreciate…here is code.
 *     ```
       <table width="50%" cellpadding="10" cellspacing="10" border="0">
       		<tr>
       			<td>Select Tournament:</td>
       			<td><select name="tournamentid"><?php
       			$results = $wpdb->get_results("select * from wp_tournamentmanagertournaments");
       			foreach($results as $result)
       				{
       			echo "<option value=\"".$results->tournamentid."\">".$results->tournamentname."</option>\n  ";
       			echo "<option value='1'>1</option>";
       				}
       			echo "</select>";
       }
       ?></td></tr>
       	</table>
       ```
   
 * getting select box with one option per row coming out of database as well as 
   a 1 option..but no value or text in the box or the label.
 * thanks in advance.

The topic ‘admin dynamic sleect box’ is closed to new replies.

 * 0 replies
 * 1 participant
 * Last reply from: [craigcmurray](https://wordpress.org/support/users/craigcmurray/)
 * Last activity: [14 years, 4 months ago](https://wordpress.org/support/topic/admin-dynamic-sleect-box/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
