Jump to content

Save HTML to Database


pswork

Recommended Posts

I need to save HTML in database.

if (!Db::getInstance()->insert('table_name', [
	'content' => pSQL(htmlentities($value['content'])),
])) {
	return false;
}

Database result: <strong>Text</strong>

It is saved sentence.

And then I read from database and show HTML dynamically by JS.

A can't see js in result, but I see just HTML like text - <strong>Text</strong>

Edited by pswork (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...