You could just add the name of the file to the database instead of storing the content of the document on the db, anyway, if you have the information on the db when you want to view the file content, you should add a proper header to the php file that reads from the db, I think the code for displaying the file is the next:
<?php
your access and reading from db
header ( "Content-type: application/pdf" );
then echo $result["doc_row"];?>
hope that work, you should read about Header.
Hector
http://www.oksonora.com