
January 12th, 2004, 05:56 PM
|
|
Registered User
|
|
Join Date: Jul 2003
Posts: 11
Time spent in forums: 1 h 47 m 43 sec
Reputation Power: 0
|
|
|
Viewing jpg's with PHP
I am trying to connect to Oracle 9i db and query for a jpeg. I keep on recieving a windows download popup after executing the webpage. I have enclosed the code. The sql is correct. Dont know what else is wrong. PHP and GD is setup correctly. I can view jpegs through php with a flat file used for storage. Thanks.
<?php
$username = "xxxxxxxx";
$passwd = "xxxxxxxxx";
$db="xxxxxxxxxx";
$conn = OCILogon($username,$passwd,$db);
if (!$conn) {
echo "Connection failed";
echo "Error Message: [" . OCIError($conn) . "]";
exit;
}
else
{
echo "Successfully Connected to Database!\n\n";
}
;
$conn = OCILogon($user, $password,$db );
$query = "select dbd_image from database where patronid ='11111111'";
$stmt = OCIParse($conn, $query);
$err = OCIExecute($stmt);
OCIFetchInto($stmt);
header('Content-Type: image/jpg');
print $stmt;
ocilogoff($conn);
?>
|