Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- mysql_connect("localhost", "user", "pw") or die(mysql_error());
- mysql_select_db("DBName) or die(mysql_error());
- $query="SELECT tsName FROM users";
- $result = mysql_query($query);
- echo '<select name="users">';
- while($nt=mysql_fetch_array($result)){ //Array or records stored in $nt
- echo '<option value="' . $nt['id'] . '">' . $nt['name'] . '</option>';
- /* Option values are added by looping through the array */
- }
- echo '</select>'; // Closing of list box
- ?>
Advertisement
Add Comment
Please, Sign In to add comment