entercow 9 Newbie Poster

Hi All.

I am having some troubles pulling an Image Blob from a DB and rendering it to the webpage. I can successfully get the images, but when I display them they are being cut off at 4.0Kb - so only the top 25% or so is being displayed. I've tried a few variants of the code below and can't seem to figure it out. This is my first time working with a blob, can anyone help? I have verified that the full images are inside the DB based on filesize.

File: get_blob.php

header ("Content-type: image/jpeg");

//connect to database
---snip --

//query database
$sqlquery="SELECT image AS theimage FROM IDX_IMAGES_FULL WHERE id='1234'";

$process=odbc_exec($sqlconnect, $sqlquery);
$row=odbc_fetch_array($process);

//print image
$img = $row['theimage'];
print $img;

//close connection
odbc_close($sqlconnect);

I'm calling it like this (works, but images get cut off).

HTML Page:

<img src=get_blob.php?id=1234 />
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.