Subject Re: Problem in retrieving BLOB data
Author bala_karat
Thanks again Lester Caine for yr valuable time.

I tried the following:

$host = "localhost:C:/BK_Share/file_test/FILE.FDB";
ibase_connect($host, "SYSDBA", "masterkey");
$result = ibase_query("select TEST from EMPLOYEEMASTER where EMPCODE = '002'");
$data = ibase_fetch_object($result,IBASE_TEXT);
$blob_hndl = ibase_blob_open($data->TEST);
echo $blob_hndl;

but getting the error:
Message: ibase_blob_open() [function.ibase-blob-open]: String is not a BLOB ID

Something is wrong somewhere, also tried some other combinations without success.

With regards,
Bala

--- In firebird-php@yahoogroups.com, Lester Caine <lester@...> wrote:
>
> bala_karat wrote:
> > Thanks Lester Caine.
> >
> > option 1: no luck. I am getting the error:
> > "Message: ibase_blob_info() [function.ibase-blob-info]: Unrecognized BLOB ID"
> > May be I am making some silly mistake. Following is my code now:
> >
> > $data = ibase_fetch_object($result,IBASE_TEXT);
> > $blob_data = ibase_blob_info($data->TEST);
> You don't need this
> > $blob_hndl = ibase_blob_open($data->TEST);
> This will return the contents of the blob as a string ...
> > echo ibase_blob_get($blob_hndl,$blob_data[0]);
> Also not needed for option 1
>
> The blob fields will just appear as long strings with the other data ...
>
> > option 2: For this project we are already using codeigniter with ibase. Since we got in to problems with blob, started using the direct php functions for this part. Is it OK to use ADODB also?
>
> I've never used anything other than ADOdb myself, and where we have to
> link to other database engines everything is just transparent, but it's
> not the lightest way of doing the job - just convenient ...
>
> --
> Lester Caine - G8HFL
> -----------------------------
> Contact - http://lsces.co.uk/wiki/?page=contact
> L.S.Caine Electronic Services - http://lsces.co.uk
> EnquirySolve - http://enquirysolve.com/
> Model Engineers Digital Workshop - http://medw.co.uk//
> Firebird - http://www.firebirdsql.org/index.php
>