General SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesGeneral SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
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  
Old April 6th, 2004, 06:18 AM
SallyO SallyO is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 1 SallyO User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old September 8th, 2004, 07:52 PM
cjbj cjbj is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 1 cjbj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally Posted by SallyO
Hi,

My table contains 2 columns, ID number(5) and IMAGE blob.

. . .

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.
There is a working example at http://forums.oracle.com/forums/thread.jsp?forum=178&thread=233174&message=664200&q=7361766566696c65#664200

(Free registration required)

-- CJ

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesGeneral SQL Development > Problems displaying Oracle BLOB through PHP on Browser.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway