function db_escape_table
7.x database.inc | db_escape_table( |
6.x database.inc | db_escape_table($string) |
Restrict a dynamic table, column or constraint name to safe characters.
Only keeps alphanumeric and underscores.
Related topics
11 calls to db_escape_table()
- db_column_exists in drupal-6.x/
includes/ database.pgsql.inc - Check if a column exists in the given table.
- db_column_exists in drupal-6.x/
includes/ database.mysqli.inc - Check if a column exists in the given table.
- db_column_exists in drupal-6.x/
includes/ database.mysql.inc - Check if a column exists in the given table.
- db_last_insert_id in drupal-6.x/
includes/ database.pgsql.inc - Returns the last insert id. This function is thread safe.
- db_lock_table in drupal-6.x/
includes/ database.pgsql.inc - Lock a table. This function automatically starts a transaction.
File
- drupal-6.x/
includes/ database.inc, line 422 - Wrapper for database interface code.
Code
function db_escape_table($string) {
return preg_replace('/[^A-Za-z0-9_]+/', '', $string);
}