|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Problems displaying Oracle BLOB through PHP on Browser.
Hi,
My table contains 2 columns, ID number(5) and IMAGE blob. I have 1 row at the moment with ID = 1 and an image. When I do a count on the IMAGE column I am getting 1 result. My select.php file contains a basic select of ID and returns the result in a table. I also want to display the associated image and have created getimage2.php file to get the image and I point to this via the <IMG SRC=" "> tags. When I run my select.php file I am getting the table with the ID (1) in column 1 but the image is not displaying. Any advice would be great, I've included the code from my files below. I don't get any error messages when these run just no image. SELECT.PHP <? include 'dbconnect.htincl'; ?> <HTML> <BODY> <? $sql="SELECT ID, IMAGE FROM TOPS"; $sql_parse=ociparse($connection,$sql) or die ("Couldn't Parse Statement"); ociexecute($sql_parse) or die ("Couldn't Execute Statement"); ?> <CENTER> <TABLE BORDER=1> <TR><TH>ID</TH><TH>IMAGE</TH></TR> <? while (ocifetch($sql_parse)) { $id=ociresult ($sql_parse,1); ?> <TR> <TD><?echo"$id";?></TD> <TD><IMG SRC="getimage2.php?ImgID=1"></TD> </TR> <?}?> </TABLE> </CENTER> </BODY> </HTML> GETIMAGE2.php <? include 'dbconnect.htincl'; ?> <HTML> <BODY> <? if($ImgID != 0) { $Query = "Select image from tops where id = $ImgID"; $Parse=ociparse($connection,$Query) or die ("NO PARSE"); ociexecute ($Parse) or die ("NO EXECUTE"); While (ocifetch($Parse)) { header("Content-type: image/jpeg"); print (ociresult($Parse)); } } ?> </BODY> </HTML> Thanks, Sally |
|
#2
|
|||
|
|||
|
Quote:
(Free registration required) -- CJ |
![]() |
| Viewing: Dev Articles Community Forums > Databases > General SQL Development > Problems displaying Oracle BLOB through PHP on Browser. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|