Well, since our php guy is on a 3-week leave (his wife had a baby) and we needed to get this done,
it has fallen on my lap and I haven't got a clue what I am doing
but I have been able to put this code together.
I am an asp programmer, not php
So far, I am getting errors that I really don't know how to resolve.

Here is the error:
Notice: Undefined index: SITE_CODE in e:\inetpub\wwwroot\reports.php on line 13
Record doesn't exist.

I was wondering if someone could be kind enough to help me resolve this.

Here is my table structure.
Table name: Access database
ID autonumber
sitecode text
filesize number
filedata OLE Object (or BLOB)
contentType text
filename text

I know the reason is because I am using mySQL syntax but my database is not mySQL.

Here is the php version I have been working on.
I truly appreciate any help.

Code:
<?php
// DB connection here.
$conn=odbc_connect('counts','','');

$sql = "SELECT FileData FROM trafficCountsFiles,fctrafic where fctrafic.site_code = trafficcountsFiles.sitecode and siteCode = '".$_GET["siteCode"]."'"; $rs=odbc_exec($conn,$sql);

if (!$rs)
{
 exit("Error in SQL");
}
if (($rs) == 1)

{

$fileType = mysql_result($result, 0, "contentType");
$fileContent = mysql_result($result, 0, "filedata");
header("Content-Type: $fileType");
header("Content-Length: " . strlen($filedata));
header("Content-Disposition: inline; filename=file.pdf;");

echo $fileContent;

}

else

{

echo "Record doesn't exist.";

}

?>
Here is the error that I am getting:
Notice: Undefined index: SITE_CODE in e:\inetpub\wwwroot\reports.php on line 13
Record doesn't exist.
I have done something similar to above in asp:

Please see:

<%


' Create ADO Connection
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Provider=SQLOLEDB.1;Password=myPass;Persist Security Info=True;User ID=myUser; " & _
"Initial Catalog=Traf;Data Source=ipw "
Response.ContentType = "application/pdf"
' Create Recordset
Set RecSet = Server.CreateObject("ADODB.Recordset")
RecSet.Open "select fileData from TrafficCountsFiles where siteCode ='" & Request("siteCode")& "' ", Conn, 2, 3

If Not RecSet.EOF Then
' set the ContentType property
Response.Addheader "Content-Disposition", "inline; filename=file.pdf"
' send the binary data to the webbrowser
Response.BinaryWrite (RecSet("fileData"))
End If

RecSet.Close
Set RecSet = Nothing

Conn.Close
Set Conn = Nothing

Above code allows me to click on a pdf file and open it on a browser to view contents.