function tripal_custom_tables_get_table_id
2.x tripal_core.DEPRECATED.api.inc | tripal_custom_tables_get_table_id($table_name) |
3.x tripal_core.DEPRECATED.inc | tripal_custom_tables_get_table_id($table_name) |
1.x tripal_core_custom_tables.api.inc | tripal_custom_tables_get_table_id($table_name) |
Retrieve the custom table id given the name
Parameters
$table_name: The name of the custom table
Return value
The unique identifier for the given table
Related topics
File
- tripal_core/
api/ tripal_core_custom_tables.api.inc, line 195 - Contains functions for the Custom Tables API
Code
function tripal_custom_tables_get_table_id($table_name) {
$sql = "SELECT * FROM {tripal_custom_tables} " .
"WHERE table_name = '%s'";
if (db_table_exists('tripal_custom_tables')) {
$custom_table = db_fetch_object(db_query($sql, $table_name));
if ($custom_table) {
return $custom_table->table_id;
}
}
return FALSE;
}