db_escape_table

Definition

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

Description

Restrict a dynamic table, column or constraint name 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

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

Drupal is a registered trademark of Dries Buytaert.