开发者

Partial Image display from Sybase Image data type over ODBC

I have been struggling with this all day yesterday but can't get to the bottom of it.

I have an existing database that I am trying to retrieve an image from (I know image storing is bulky but it's what I'm stuck with). I am able to query the appropriate database field and get the data out but when I display it, it seems like only part of the data is being displayed.

I am using this code to display the image:

require_once('开发者_如何学Python../odbc_config.php');
if((isset($_GET['ur'])) AND ($_GET['ur'] != "")) {
    $aria_query1_ur = $_GET['ur'];
    $aria_query1 = "SELECT * FROM Patient WHERE PatientId='$aria_query1_ur' ";
    $patient_result = odbc_exec($aria,$aria_query1) or die("Error getting Patient Data");
    $patient_data = odbc_fetch_array($patient_result);
    }
$ID=$patient_data['PatientSer'];
$query = odbc_exec($aria, "SELECT * FROM Photo WHERE PatientSer=".$ID);
$row = odbc_fetch_array($query);
$content = $row['Picture'];
header('Content-type: image/jpeg');
echo $content;

I am calling this code like this:

echo '<img src="contents/image2.php?ur='.$_GET['ur'].'">';

Unfortunately I only seem to be able to display the image partially. The dimensions of the image are correctly read and I can see the first 50 x 480 or so pixels from the top but after that all I see is a gray background of 640 x 480 pixels.

Like this: http://i1218.photobucket.com/albums/dd411/Barbs_ldsr/stuff/th_partial_image.jpg

Is it possible the Sybase ODBC driver is only allowing a certain amount of data through? How would I check or fix this? Or is there a problem with the PHP?

Any help appreciated. Thanks


I commented the solution to our problem has to do with the limited text editing the php.ini solves it. Finds the next row. odbc.defaultlrl = 4096 Only enlarges the value for example odbc.defaultlrl = 40960000 and now with this whole picture leaves you. I hope will be of your help and cuerdate we put the answer in the forums where nannies asked for when someone else runs into this will solve

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜