function tripal_get_db_select_options

2.x tripal_db.api.inc tripal_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

2 calls to tripal_get_db_select_options()
chado_stock_form in tripal_stock/includes/tripal_stock.chado_node.inc
Implements hook_form(). Creates the main Add/Edit/Delete Form for chado stocks
tripal_db_get_db_options in tripal_db/api/tripal_db.DEPRECATED.inc
1 string reference to 'tripal_get_db_select_options'

File

tripal_db/api/tripal_db.api.inc, line 138
Provides an application programming interface (API) to manage references to external databases

Code

function tripal_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;

}