PHP Save special characters html encoded in mySQL
<p>I am trying to convert special character into html characters and then save this to the database.</p>

<p>So if I do this:</p>

<pre><code>myString = '123%';

myNewString = htmlentities(myString);
</code></pre>

<p>I then save this to the database but what I'm getting is:</p>

<pre><code>123%
</code></pre>

<p>and not</p>

<pre><code>123&amp;#37;
</code></pre>

<p>How can I do this?</p>
