Home  >  Article  >  Backend Development  >  html代码插入mysql的有关问题

html代码插入mysql的有关问题

WBOY
WBOYOriginal
2016-06-13 13:53:45803browse

html代码插入mysql的问题
想把下列代码插入mysql  
 html代码插入mysql的有关问题 接手任务
获得";
我用
$str3=" html代码插入mysql的有关问题 接手任务
获得";
讲里面的"转义了 插入mysql还是不行 为什么? 应该怎么弄才能将上面的html代码插入mysql呢?
我查了查网上说用addsalshes()函数 我很纳闷 函数里面的参数怎么写呢 是直接讲html代码用双引号括起来 还是转义以后才用双引号括起来放进去?

------解决方案--------------------
写错了,一开始的str3不用加转义符\
修改如下:

PHP code
$str3 = ' html代码插入mysql的有关问题  接手任务  
获得"; ' $str3 = addsalshes($str3);
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