function chado_get_db_select_options

3.x tripal_chado.db.api.inc chado_get_db_select_options()

Create an options array to be used in a form element which provides a list of all chado dbs.

Return value

An array(db_id => name) for each db in the chado db table.

Related topics

3 calls to chado_get_db_select_options()
data__accession_widget::form in tripal_chado/includes/TripalFields/data__accession/data__accession_widget.inc
sbo__database_cross_reference_widget::form in tripal_chado/includes/TripalFields/sbo__database_cross_reference/sbo__database_cross_reference_widget.inc
tripal_get_db_select_options in tripal_chado/api/modules/tripal_chado.module.DEPRECATED.api.inc
Create an options array to be used in a form element which provides a list of all chado dbs.

File

tripal_chado/api/modules/tripal_chado.db.api.inc, line 146
Provides API functions specificially for managing external database reference records in Chado.

Code

function chado_get_db_select_options() {

  $dbs = chado_query("SELECT db_id, name FROM {db} ORDER BY name");

  $options = array();
  $options[] = 'Select a Database';

  foreach ($dbs as $db) {
    $options[$db->db_id] = $db->name;
  }

  return $options;

}