That would be silly, then the backslash will be shown everywhere.
>> SELECT 'here is an apostrophe: \'';
>> returns: here is an apostrophe: '
The backslash is not part of the string but just a hint to the compiler. The literal string '\'' represents a one byte (if ASCII) string containing only a single apostrophe character. Gijs in \'t Veld
is a 'sanitized' version of Gijs in 't Veld
and saying that 'Gijs in \'t Veld'
is a SQL String literal representing the string Gijs in 't VeldOnly escaping quotes that are inserted directly into SQL query strings is not what I understood by "sanitizing all input".
This SQL literal string:
'Gijs in \'t Veld'
Is a representation for these ASCII bytes/content: Gijs in 't Veld
In other words. The backslash will not be stored as part of the string into the database. It's just a hint to the SQL parser that the following single quote should be interpreted as a literal single quote char and not as the end-of-string-character.From a security perspective there is nothing more "proper" about prepared queries than correctly escaped non-prepared queries.