title: PHP/MySQL download file
body: <p>I am using php/mysql in my table I have a column called 'PDF'.</p>
  
  <p>Each row has a path to a PDF file on my web server, I am using this PHP code:</p>
  
  <pre><code>$sql="SELECT * from table1 where customer_sequence = '53' and invoice_number = '1234' and sequence = '7839' ";
  $rs=mysql_query($sql,$conn) or die(mysql_error());
  $result=mysql_fetch_Array($rs);
  
  header('Content-disposition: attachment; filename=/path/to/file/'.$result["pdf"].'');
  header('Content-type: application/pdf');
  readfile('/path/to/file/'.$result["pdf"].'');
  </code></pre>
  
  <p>The SQL is working ok, but once it tries to download its not doing anything.</p>
  
  <p>I have also tried:</p>
  
  <pre><code>header("Location: /path/to/file/".$result["pdf"]."");
  </code></pre>
  
  <p>but still no luck - any ideas what I can do?</p>