Error message

You are browsing documentation for drupal 7.x, which is not supported anymore. Read the updated version of this page for drupal 11.x (the latest version).

function DatabaseConnection::tablePrefix

Find the prefix for a table.

This function is for when you want to know the prefix of a table. This is not used in prefixTables due to performance reasons.

File

includes/database/database.inc, line 507

Class

DatabaseConnection
Base Database API class.

Code

public function tablePrefix($table = 'default') {
 if (isset($this->prefixes [$table])) {
 return $this->prefixes [$table];
 }
 else {
 return $this->prefixes ['default'];
 }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.