title: php echo rich text from code in a mysql database
body: <p>I am wondering how to echo data stored in a database as rich text.   I can put the data in the database, but it stores it as code.   I want it to echo as formatted text using PHP.  For example, if one of my users inputs the chemical formula CO<sub>2</sub> with the 2 subscripted, it will be stored in the MySQL database as the code:</p>
  
  <pre><code>     CO&lt;sub&gt;2&lt;/sub&gt;
  </code></pre>
  
  <p>I don't want this code to be echoed.  Instead I want the formatted text "CO<sub>2</sub>" to be echoed.   Is this possible and if so how?   I would like all the rich text markup to be echoed instead as actual formatted text rather than code. </p>