Select form, write selected item to database
First of all, there is a small error in your code, $options should be an array. Moreover, if you add a key=>value pair for each option, you can get the key of the selected option in the form_submit function. Here is what your foreach could look like:

foreach($result as $row) {
  $options[$row-&gt;ID] = $row-&gt;color . ' ' .$row-&gt;name; 
}


and in your submit function you can grab the ID of the selected option like this:

$color_id = $form_state['values']['color'];


Good luck!