db_escape_table

Definition

db_escape_table($string)
drupal/includes/database.inc, line 321

Description

Restrict a dynamic tablename to safe characters.

Only keeps alphanumeric and underscores.

Related topics

Namesort iconDescription
Database abstraction layerAllow the use of different database servers using the same code base.

Code

function db_escape_table($string) {
  return preg_replace('/[^A-Za-z0-9_]+/', '', $string);
}