title: How to prevent tags and scripts from executing in HTML?
body: <p>I am using prepared statements from Mysqli. This takes the input as text and submits it as text, preventing SQL injections.</p>
  
  <p>The problem arises when I read text from database. The text I read executes in the browser!</p>
  
  <p>For instance - if I write as input:</p>
  
  <pre><code>&lt;b&gt;Hello&lt;/b&gt; how r u?&lt;br&gt;
  &lt;script&gt; alert('He is fine dnt wry!') &lt;/script&gt;
  </code></pre>
  
  <p>This goes into the database as it is. But when I read it back from the database using my <code>SELECT</code> query, and display it, instead of displaying, my <code>&lt;b&gt;</code> tags and <code>&lt;script&gt;</code> tags get executed!</p>
  
  <p>How can I prevent this from happening?</p>