将HTML保存到数据库/ SQL中

when I save html code with php in the database, the html code looks like:

& lt ; b & gt ; (for <b>)

I know they are special characters. When I want to display it with echo, I have to decode it with:

html_entity_decode($test);

How can I save the html without specials chars so that I wouldn't need the html_entity_decode?

Thank you.

when I save html code with php in the database....

No you seem to be saving HTML encoded HTML code. So given some HTML code you are currently encoding it as html (htmlspecialchars()), encoding it for insert (via mysql[i]_real_escape_string() or parameter binding) into the database and de-encoding it on retrieval - just skip the extra encoding.