Mysql's escape character ""

zhaozj2021-02-16  45

MySQL escape character "/" mysql identifies the following translination characters: / 0 A ASCII 0 (NUL) character. / N A new line character. / T a locator. / R A carriage return. / B A escape. / 'A single quotes ("'"). / "A double quotation mark (" ""). // A backslash ("/") function. /% A "%" character. It is used to search "%" text instance in the body, otherwise "%" will be construed as a wildcard. / _ A "_" character. It is used to search for "_" text instance in the body, otherwise "_" will be interpreted as a wildcard. Note that if you use "/%" or "/% _" in some textures, these will return strings "/%" and "/ _" rather than "%" and "_". ★★ There are several ways to include quotes in a string: 1, must escape: a string is referenced by single quotation marks "'", the single quotes "'" in this string can be "''" Mode escape. A string is referenced by dual quotation marks "" "," "" "characters in this string can be escaped in" "". At the same time, you can also continue to use a escape character "/" to escape 2, can not be used: a string "" "is referenced, the single quotes" '"in this string do not need special treatments And it is not necessary to be repeated or escaped. Similarly, a string is referenced by single quotation marks "'", and the dual quotes "" "in this string do not need special treatments and do not have to be repeated or escaped.

转载请注明原文地址:https://www.9cbs.com/read-27195.html

New Post(0)