db_escape_table

  1. drupal
    1. 4.7
    2. 5
    3. 6 database.inc
    4. 7 database.inc
Versions
4.7 – 6 db_escape_table($string)
7 db_escape_table($table)

Restrict a dynamic tablename to safe characters.

Only keeps alphanumeric and underscores.

Related topics

▾ 7 functions call db_escape_table()

db_lock_table in includes/database.mysql.inc
Lock a table.
db_lock_table in includes/database.mysqli.inc
Lock a table.
db_lock_table in includes/database.pgsql.inc
Lock a table. This function automatically starts a transaction.
db_table_exists in includes/database.mysql.inc
Check if a table exists.
db_table_exists in includes/database.mysqli.inc
Check if a table exists.
db_table_exists in includes/database.pgsql.inc
Check if a table exists.
node_load in modules/node/node.module
Load a node object from the database.

Code

includes/database.inc, line 311

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