I am using php/mysql in my table I have a column called 'PDF'.
Each row has a path to a PDF file on my web server, I am using this PHP 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"].'');
The SQL is working ok, but once it tries to download its not doing anything.
I have also tried:
header("Location: /path/to/file/".$result["pdf"]."");
but still no luck - any ideas what I can do?