escaping - How to escape apostrophe (') in MySql? -
the mysql documentation says should \'. however, both scite , mysql shows '' works. saw , works. should do?
the mysql documentation cite says little bit more mention. says,
a “
'” inside string quoted “'” may written “''”.
(also, linked mysql 5.0 version of table 8.1. special character escape sequences, , current version 5.6 — current table 8.1. special character escape sequences looks pretty similar.)
i think postgres note on backslash_quote (string) parameter informative:
this controls whether quote mark can represented
\'in string literal. preferred, sql-standard way represent quote mark doubling ('') postgresql has historically accepted\'. however, use of\'creates security risks...
that says me using doubled single-quote character better overall , long-term choice using backslash escape single-quote.
now if want add choice of language, choice of sql database , non-standard quirks, , choice of query framework equation, might end different choice. don't give information constraints.
Comments
Post a Comment