db_table_exists

  1. drupal
    1. 5 database.pgsql.inc
    2. 5 database.mysqli.inc
    3. 5 database.mysql.inc
    4. 6 database.mysqli.inc
    5. 6 database.mysql.inc
    6. 6 database.pgsql.inc
    7. 7
    8. 8
Versions
5 – 8 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

▾ 22 functions call db_table_exists()

DatabaseRegressionTestCase::testDBTableExists in modules/simpletest/tests/database_test.test
Test the db_table_exists() function.
DatabaseTemporaryQueryTestCase::testTemporaryQuery in modules/simpletest/tests/database_test.test
Confirm that temporary tables work and are limited to one request.
DatabaseTestCase::installTables in modules/simpletest/tests/database_test.test
Set up several tables needed by a certain test.
drupal_uninstall_schema in includes/common.inc
Remove all tables that a module defines in its hook_schema().
field_sql_storage_schema in modules/field/modules/field_sql_storage/field_sql_storage.install
Implements hook_schema().
field_sql_storage_update_7001 in modules/field/modules/field_sql_storage/field_sql_storage.install
Remove the field_config_entity_type table and store 'entity_type' strings.
image_update_7000 in modules/image/image.install
Install the schema for users upgrading from the contributed module.
image_update_7001 in modules/image/image.install
Rename possibly misnamed {image_effect} table to {image_effects}.
menu_update_7002 in modules/menu/menu.install
Rename the primary/secondary menu blocks to match previously renamed menus.
ModuleTestCase::assertModuleTablesDoNotExist in modules/system/system.test
Assert that none of the tables defined in a module's hook_schema() exist.
ModuleTestCase::assertModuleTablesExist in modules/system/system.test
Assert that all tables defined in a module's hook_schema() exist.
SchemaTestCase::testSchema in modules/simpletest/tests/schema.test
system_update_7053 in modules/system/system.install
Upgrade standard blocks and menus.
system_update_7060 in modules/system/system.install
Create fields in preparation for migrating upload.module to file.module.
system_update_7061 in modules/system/system.install
Migrate upload.module data to the newly created file field.
tablesort_example_install in examples/tablesort_example/tablesort_example.install
Implements hook_install().
update_fix_d7_block_deltas in includes/update.inc
A helper function that modules can use to assist with the transformation from numeric block deltas to string block deltas during the 6.x -> 7.x upgrade.
update_fix_d7_requirements in includes/update.inc
Perform Drupal 6.x to 7.x updates that are required for update.php to function properly.
update_info_page in ./update.php
update_prepare_d7_bootstrap in includes/update.inc
Performs extra steps required to bootstrap when using a Drupal 6 database.
UpgradePathTaxonomyTestCase::testTaxonomyUpgrade in modules/simpletest/tests/upgrade/upgrade.taxonomy.test
Basic tests for the taxonomy upgrade.
user_system_info_alter in modules/user/user.module
Implements hook_system_info_alter().

Code

includes/database/database.inc, line 2729

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