title: Viewing PDF files stored in MySQL database using PHP error
body: <p>I am creating a button, that on click it views the PDF uploaded in the MySQL database in new window
  here's my code:</p>
  
  <p>Button:</p>
  
  <pre><code>&lt;td&gt;&lt;a href='view.php?id={$row['id']}'&gt;View&lt;/a&gt;&lt;/td&gt;
  </code></pre>
  
  <p>view.php:</p>
  
  <pre><code>&lt;?php
  
  header('Content-type: application/pdf');
  echo $pdf_from_database;  
  </code></pre>
  
  <p>the code seems to work and newtab is started, adope start loading, and then I get an error:</p>
  
  <blockquote>
    <p>file does not begin with "%pdf-" </p>
  </blockquote>
  
  <p>Anyone knows how to solve the problem?</p>