|
Posted by Mike Willbanks on 10/18/05 15:04
José Checa,
> Hello all.
>
> I have a function in PHP to retreive a BLOB field in Oracle DB who has a
> JPEG image in it; but I don´t know how show it in an html page with text
> information, I have something like this, but doesn´t work properly:
>
> Any idea. Thanks in advance. Pepe.-
>
Create a file that calls the image, outputs the header for the jpeg and
then dumps the data in that file. You can not just output the image
directly into the src area ;)
Something like:
image.php
$conn = oci_logon();
$stmt = oci_parse($conn, 'select image_blob from images where image_id =
:image_id');
$image_id = (int) $_GET['image_id'];
oci_bind_by_name($stmt, ':image_id', $image_id);
oci_execute($stmt);
$row = oci_fetch_assoc($stmt);
header('Content-Type: image/jpeg');
echo $row['IMAGE_BLOB'];
Something like that, I did not check it but most of it was for php5 ;)
--
Mike Willbanks
Zend Certified Engineer
http://www.digitalstruct.com
[Back to original message]
|