Subject Re: [firebird-php] Binary data
Author Lester Caine
masotti wrote:
> On 27/02/2012 10:20, Lester Caine wrote:
>> > Just to elaborate, The driver is using IBASE_TEXT to return the data and I
>> > suspect the current failure is simply that it stops at the first '00' as
>> > I am
>> > convinced that all that data after the '00' has been stored. I think a
>> > stream
>> > read is needed to get all the data, such as a compressed data packet?
> From PHP docs, IBASE_TEXT has meaning only for BLOB fields, should be
> ignored for VARCHAR and CHAR.
Yes, but it's used by many 'abstraction layers' to return strings rather than
having to handle resources. I think this is also where PDO falls over at times?
But in this case it's the Zend Framework I'm trying to massage into working
properly with Firebird.

> So, if you have a BLOB binary field, it should be subtype 0, and in that
> case should be returned as is.
I agree with that and for the time being I will just ignore the compress option
for that section of the package.

> Other problem is the PHP variable where you store it.
> AFAIR PHP has nothing except resources to store such data...
BLOB yes ... and If I'm going to fix anything there it will be with ADOdb rather
than Zend.

But returning to CHAR ... If I configure that field as CHARACTER SET OCTET I
should be able to simply handle the hex2bin output? I'm just about to dive into
tidying that particular bodge up as currently I'm using CHAR(16) and just
storing the hex :)

--
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