$Options[] = JHTML::_('select.option', '0', 'Please select' );
$db = JFactory::getDbo();
$db->setQuery("SELECT id, text FROM #__tablename");
$rows = $db -> loadObjectList();
foreach ($rows as $row) {
$Options[] = JHTML::_('select.option', $row->id, $row->text);
}
return $Options;