Home >Backend Development >PHP Tutorial > mysql转义字符插入、查询及显示有关问题,求点拨

mysql转义字符插入、查询及显示有关问题,求点拨

WBOY
WBOYOriginal
2016-06-13 12:36:39831browse

mysql转义字符插入、查询及显示问题,求点拨
RT,通常php+mysql的单引号,“\”符号插入一般采用addslashes()方式 

假如,现在插入$varstr = test'\,问题如下:
1.带addslashes(),insert插入后在mysql中存放格式是test'\,还是test\'\\

3.select出来后,echo $varstr;显示是test'\,还是test\'\\

2.selelct以该变量字符串为条件查询时,是否需要加addslashes()?

mysql关于转义字符问题,很头疼,希望专家出来点拨下,谢了!

mysql?转义字符?特殊字符
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn