function tripal_db_get_db_options

2.x tripal_db.DEPRECATED.inc tripal_db_get_db_options()
3.x tripal_db.DEPRECATED.inc tripal_db_get_db_options()
1.x tripal_db.api.inc tripal_db_get_db_options()

Purpose: 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

5 calls to tripal_db_get_db_options()
chado_stock_form in tripal_stock/tripal_stock.module
Implements hook_form(): Creates the main Add/Edit/Delete Form for chado stocks
tripal_feature_add_ONE_dbreference_form in tripal_feature/includes/tripal_feature-db_references.inc
Implements Hook_form() Handles adding of Database References to features
tripal_feature_edit_ALL_db_references_form in tripal_feature/includes/tripal_feature-db_references.inc
Implements Hook_form() Handles adding of DB References to Features
tripal_stock_add_ONE_dbreference_form in tripal_stock/includes/tripal_stock-db_references.inc
Implements Hook_form(): Handles adding of Database References to Stocks
tripal_stock_edit_ALL_db_references_form in tripal_stock/includes/tripal_stock-db_references.inc
Implements Hook_form(): Handles adding of Database References to Stocks

File

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

Code

function tripal_db_get_db_options() {

  $result = chado_query(
  "SELECT db_id, name FROM {db}"
  );

  $options = array();
  while ($r = db_fetch_object($result)) {
    $options[$r->db_id] = $r->name;
  }

  return $options;

}