To insert html code into mysql, I want to insert the following code into mysql & nbsp; & lt; imgsrc = & quot ;.. /image/online_admin1_12.16.gif & quot; & gt; & lt; ahref = & quot; $ missionid & q html code insert mysql
Want to insert the following code into mysql
Claim task
Get ";
I use
$ Str3 = "claim the task
Get ";
In the lecture, "cannot I insert mysql without escaping it? why? How can I insert the above html code into mysql?
I checked the Internet and said that the addsalshes () function is used. I am wondering how to write the parameters in the function. does it mean that the html code is enclosed in double quotation marks or escaped before being enclosed in double quotation marks?
------ Solution --------------------
Wrong. str3 at the beginning does not need an escape character \
Modify as follows:
PHP code
$ Str3 = 'claim the task
Get "; '$ str3 = addsalshes ($ str3 );