title: Correct sequence of actions when using Markdown & MySQL?
body: <p>I want my users to be able to write an article in Markdown, have it stored in the MySQL database (with the option to edit it in the future), and displayed for other users.</p>
  
  <p>In practice, this is my understanding of how it works:</p>
  
  <p>INPUT</p>
  
  <ol start="2">
  <li>user input via HTML form using Markdown syntax</li>
  <li><code>$queryInput = mysql_real_escape_string($userInput);</code></li>
  <li>insert sanitized string into database</li>
  </ol>
  
  <p>OUTPUT</p>
  
  <ol>
  <li>query field from database</li>
  <li><code>$output = Markdown($queryResult);</code></li>
  <li>display <code>$output</code></li>
  </ol>
  
  <p>Is that it?</p>
  
  <p>Does PHP Markdown preclude the need for <code>htmlspecialchars</code> or <code>Pure HTML</code> ?</p>
  
  <p>Thanks!</p>