title: Storing HTML in MySQL
body: <p>I'm storing HTML and text data in my database table in its raw form - however I am having a slight problem in getting it to output correctly. Here is some sample data stored in the table AS IS:</p>
  
  <pre><code>&lt;p&gt;Professional Freelance PHP &amp; MySQL developer based in Manchester.
  &lt;br /&gt;Providing an unbeatable service at a competitive price.&lt;/p&gt;
  </code></pre>
  
  <p>To output this data I do:</p>
  
  <pre><code>echo $row['details'];
  </code></pre>
  
  <p>And this outputs the data correctly, however when I do a W3C validator check it says:</p>
  
  <pre><code>character "&amp;" is the first character of a delimiter but occurred as data
  </code></pre>
  
  <p>So I tried using <code>htmlemtities</code> and <code>htmlspecialchars</code> but this just causes the HMTL tags to output on the page.</p>
  
  <p>What is the correct way of doing this?</p>