It's best to use the COM_optionList function to generate the html list of options.
Text Formatted Code
echo '<select name="usernames>';
echo COM_optionList($_TABLES['users'],'uid,username');
echo '</select>'
Geeklog components by PortalParts -- www.portalparts.com