Hi,
I have into a MS SQL Server database one column within image data type. I have introduced inside a pdf file. How can I extract it? I think that database saves a pointer with file information. My database have a table called "proves" and one column with the pdf file called "documents". The code that I use to extract the pdf is:
header("Content-type: application/pdf");
$link=mssql_connect('SERVER2','sa')
or die('Error conectant amb el servidor de BD');
mssql_select_db('model',$link)
or die('Error en seleccionar la base de dades');
$query = 'SELECT documents from proves';
$res = mssql_query($query);
$pdf = mssql_fetch_array($res);
$contingut = $pdf['documents'];
fread($res,filesize($pdf));
This is the code to remove a single row. At the moment I do not have more fields. The error that it gives me is:
Supplied resource is not a valid File-Handle resource.
Sorry for my english. thank you