db_find_tables

Definition

db_find_tables($table_expression)
drupal/includes/database/database.inc, line 1935

Description

Find all tables that are like the specified base table name.

Parameters

$table_expression An SQL expression, for example "simpletest%" (without the quotes). BEWARE: this is not prefixed, the caller should take care of that.

Return value

Array, both the keys and the values are the matching tables.

Related topics

Namesort iconDescription
Schema APIA Drupal schema definition is an array structure representing one or more tables and their related keys and indexes. A schema is defined by hook_schema(), which usually lives in a modulename.install file.

Code

function db_find_tables($table_expression) {
  return Database::getActiveConnection()->schema()->findTables($table_expression);
}