function tripal_get_db_select_options

2.x 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/
Implements hook_form(). Creates the main Add/Edit/Delete Form for chado stocks
tripal_db_get_db_options in tripal_db/api/
1 string reference to 'tripal_get_db_select_options'


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


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;