How can I dynamically load options into a select list?
For just populating select list options, you don't need to go through an Ajax approach! Simply write a separate function and write your database query inside it and then just call that function in '#options' of your $form['select-user-group'].

For example for displaying all node types in a select list you can use the following function:

function get_node_type_info() {

  $wizard_plugins = node_type_get_types();

  $options = array();

  foreach ($wizard_plugins as $key =&gt; $wizard) {
    // Don't forget the $ before wizard
    $options[$key] = $wizard-&gt;name;
  }

  return $options;
}


And then use this function to populate the '#options' like so:

$form['display_options'] = array(
  '#type' =&gt; 'select',
  '#title' =&gt; t('Component Type'),
  '#options' =&gt; get_node_type_info(),
);