function db_table_exists

7.x database.inc db_table_exists($table)
5.x database.mysqli.inc db_table_exists($table)
5.x database.mysql.inc db_table_exists($table)
5.x database.pgsql.inc db_table_exists($table)
6.x database.mysqli.inc db_table_exists($table)
6.x database.mysql.inc db_table_exists($table)
6.x database.pgsql.inc db_table_exists($table)
8.x database.inc db_table_exists($table)

Checks if a table exists.

Parameters

$table: The name of the table in drupal (no prefixing).

Return value

TRUE if the given table exists, otherwise FALSE.

Related topics

23 calls to db_table_exists()
DatabaseRegressionTestCase::testDBTableExists in drupal/modules/simpletest/tests/database_test.test
Test the db_table_exists() function.
DatabaseTemporaryQueryTestCase::testTemporaryQuery in drupal/modules/simpletest/tests/database_test.test
Confirm that temporary tables work and are limited to one request.
DatabaseTestCase::installTables in drupal/modules/simpletest/tests/database_test.test
Set up several tables needed by a certain test.
drupal_uninstall_schema in drupal/includes/common.inc
Removes all tables defined in a module's hook_schema().
FieldSqlStorageTestCase::testFieldUpdateFailure in drupal/modules/field/modules/field_sql_storage/field_sql_storage.test
Test that failure to create fields is handled gracefully.

... See full list

File

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

Code

function db_table_exists($table) {
  return Database::getConnection()->schema()->tableExists($table);
}