how to insert HTML code into DB using php
html, mysql, php
Solution
Do following using `addslashes()` function, so it will help easily to insert update html to
UPDATE `Pages` SET `content`= addslashes('<div id="intro">
<div id="about" align="left">
<h2 class="bigHeader" dir="rtl"HEADER</h2>
<img src="img/Med-logo.png" alt="" />
<div id="wellcomePage" class="text-left text" dir="rtl">
<p>...some words....</p>
<p>.some words....</p>
<p> </p>
</div>
</div>
</div>')
Problem
i want to update my database with new html code this it the query: ``` UPDATE `Pages` SET `content`= '<div id="intro"> <div id="about" align="left"> <h2 class="bigHeader" dir="rtl"HEADER</h2> <img src="img/Med-logo.png" alt="" /> <div id="wellcomePage" class="text-left text" dir="rtl"> <p>...some words....</p> <p>.some words....</p> <p> </p> </div> </div> </div>' ``` but all the time i get an error. how can i update my database, i don't know what will be inside this html code, is there a function that make all the code like string without special sign? EDIT:: the problem is with the special char like ' i can't change the html code, is user chice to put it.