title: How to display html from a mysql database in php
body: <p>I'm stuck with trying to figure out how to display html tags inside of a mysql table. I've tried using addslashes, mysql_real_escape_string, as well as stripslashes to view the tags properly. Everytime I view the data through the browser, it shows the text of the html. Example:</p>
  
  <p>I have this in a mysql database table:</p>
  
  <pre><code>&lt;strong&gt;Test&lt;/strong&gt;
  </code></pre>
  
  <p>It should display as this when viewed on a webpage:
  <strong>Test</strong></p>
  
  <p>But instead, it displays <code>&lt;strong&gt;Test&lt;/strong&gt;</code></p>
  
  <p>My PHP code to view the content is:</p>
  
  <pre><code>&lt;?php
  
  require_once("inc.php"); //This includes the configuration for mysql database
  
  ?&gt;
  &lt;html&gt;
    &lt;head&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;p&gt;
  &lt;?php
  
  $conn = mysql_connect(HOST,USER,PASS) or die(mysql_error());
          mysql_select_db(NAME) or die(mysql_error());
  
  $sql = "SELECT * FROM events";
  $query = mysql_query($sql);
  
  while($row = mysql_fetch_assoc($query)){
    echo(stripslashes($row['details'])); //The details is what contains the &lt;strong&gt;Test&lt;/strong&gt;
  }
  
  mysql_close($conn) or die(mysql_error());
  
  ?&gt;
      &lt;/p&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>