function chado_get_custom_table_id

2.x chado_get_custom_table_id($table_name)

Retrieve the custom table id given the name


$table_name: The name of the custom table

Return value

The unique identifier for the given table

Related topics

1 call to chado_get_custom_table_id()
1 string reference to 'chado_get_custom_table_id'


tripal_core/api/, line 275
Provides an API to manage custom tables in Chado.


function chado_get_custom_table_id($table_name) {
  if (db_table_exists('tripal_custom_tables')) {
    $sql = "SELECT * FROM {tripal_custom_tables} WHERE table_name = :table_name";
    $results = db_query($sql, array(':table_name' => $table_name));
    $custom_table = $results->fetchObject();
    if ($custom_table) {
      return $custom_table->table_id;

  return FALSE;