function tripal_db_get_db_by_name

2.x tripal_db.DEPRECATED.inc tripal_db_get_db_by_name($name)
3.x tripal_db.DEPRECATED.inc tripal_db_get_db_by_name($name)
1.x tripal_db.api.inc tripal_db_get_db_by_name($name)

Purpose: To retrieve a chado db object

Parameters

$name: db.name

Return value

chado db object with all fields from the chado db table

Related topics

File

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

Code

function tripal_db_get_db_by_name($name) {

  $values = array('name' => $name);
  $options = array('statement_name' => 'sel_db_na');

  $db = tripal_core_chado_select('db', array('*'), $values, $options);
  if (count($db) == 1) {
    return $db[0];
  }
  if (count($db) == 0) {
    return FALSE;
  }
  if (count($db) > 1) {
    return FALSE;
  }
}