There is another way to do this which may or may not be safer, depending upon your perspective. It requires MySQL 5.6 or later because of the use of a specific string function: FROM_BASE64.
Base64-encoding is a 二进制编码, so you'd better make sure that you get your character set correct when you do the encoding, because MySQL is going to decode the Base64-encoded string into bytes and then interpret those. Be sure base64 and MySQL agree on what the character encoding is (I recommend UTF-8).
This is how my data as API response looks like, which I want to store in the MYSQL database. It contains Quotes, HTML Code , etc.
例子:-
{
rewardName: "Cabela's eGiftCard $25.00",
shortDescription: '<p>adidas gift cards can be redeemed in over 150 adidas Sport Performance, adidas Originals, or adidas Outlet stores in the US, as well as online at <a href="http://adidas.com/">adidas.com</a>.</p>
terms: '<p>adidas Gift Cards may be redeemed for merchandise on <a href="http://adidas.com/">adidas.com</a> and in adidas Sport Performance, adidas Originals, and adidas Outlet stores in the United States.'
}