|
Pdo\Pgsql::escapeIdentifierEscapes a string for use as an SQL identifier Description
public string Pdo\Pgsql::escapeIdentifier(string
$input )Escapes a string for use as an SQL identifier, such as a table, column, or function name. This is useful when a user-supplied identifier might contain special characters that would otherwise not be interpreted as part of the identifier by the SQL parser, or when the identifier might contain upper case characters whose case should be preserved. Parameters
Return ValuesA string containing the escaped data. ExamplesExample #1 Pdo\Pgsql::escapeIdentifier example
The above example will output something similar to: array ( 0 => 'unescapedtablename', 1 => 'EscapedTableName', ) Fatal error: Uncaught PDOException: SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "Table" LINE 1: CREATE TABLE Table-Name-With-Symbols () See Also
|