function db_find_tables

7.x db_find_tables($table_expression)
8.x db_find_tables($table_expression)

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


$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

3 calls to db_find_tables()
DrupalWebTestCase::tearDown in drupal/modules/simpletest/drupal_web_test_case.php
Delete created files and temporary files directory, delete the tables created by setUp(), and reset the database prefix.
ModuleTestCase::assertTableCount in drupal/modules/system/system.test
Assert there are tables that begin with the specified base table name.
simpletest_clean_database in drupal/modules/simpletest/simpletest.module
Removed prefixed tables from the database that are left over from crashed tests.


drupal/includes/database/, line 2825
Core systems for the database layer.


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