Questions about inserting html code into mysql

Source: Internet
Author: User
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 );

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.