Problem extracting BLOB from Interbase !
Posted: Thu Aug 07, 2003 6:31 am
Hi
I have a problem and hope you can help me
I need to insert an image into the Interbase (BLOB SUB_TYPE 0 SEGMENT SIZE 800)
and afterwards to be able to extract it someware on my web page, but I still can not extract it right
This works but it displays only the image
<?PHP
include("sysvars.php");
$id = 108;
$dbh = ibase_pconnect($hostweb, $username, $password);
$sth = ibase_query($dbh, 'SELECT IMAGE FROM "BROSHURI" WHERE ID=' . $id);
//echo "<br>TEST<br>";
while($row = ibase_fetch_object($sth))
{
ibase_blob_echo($row->IMAGE);
}
?>
If I uncomment the //echo "<br>TEST<br>";
than the image is gone and disppalyed like : BM6@6(U@@3—›3—›3—›3—›3—›3—›3—›3—›3—›3—›3—›3—›3—›3—›3—›/љ˜) ˜1« ‘„(њЏ0 ”$˜‹/Ёљ˜‰џ”!§›џ˜ђЊ:ЎЈDџ¤5Ђ‰YљўV“—4pp%ccO“’FЋЋSЎ C–—<””......................................
I insert it like :
............
$fd2 = fopen ($image, "rb");
$bloby2 = ibase_blob_import($fd2);
.......
I presumed that the headers were the problem but I tried some things and still nothing
Can some one please help me ?
Thanks
I have a problem and hope you can help me
I need to insert an image into the Interbase (BLOB SUB_TYPE 0 SEGMENT SIZE 800)
and afterwards to be able to extract it someware on my web page, but I still can not extract it right
This works but it displays only the image
<?PHP
include("sysvars.php");
$id = 108;
$dbh = ibase_pconnect($hostweb, $username, $password);
$sth = ibase_query($dbh, 'SELECT IMAGE FROM "BROSHURI" WHERE ID=' . $id);
//echo "<br>TEST<br>";
while($row = ibase_fetch_object($sth))
{
ibase_blob_echo($row->IMAGE);
}
?>
If I uncomment the //echo "<br>TEST<br>";
than the image is gone and disppalyed like : BM6@6(U@@3—›3—›3—›3—›3—›3—›3—›3—›3—›3—›3—›3—›3—›3—›3—›/љ˜) ˜1« ‘„(њЏ0 ”$˜‹/Ёљ˜‰џ”!§›џ˜ђЊ:ЎЈDџ¤5Ђ‰YљўV“—4pp%ccO“’FЋЋSЎ C–—<””......................................
I insert it like :
............
$fd2 = fopen ($image, "rb");
$bloby2 = ibase_blob_import($fd2);
.......
I presumed that the headers were the problem but I tried some things and still nothing
Can some one please help me ?
Thanks