Subject Re: [firebird-php] Binary data
Author Lester Caine
masotti wrote:
> On 25/02/2012 12:43, Lester Caine wrote:
>> > OK ... not sure where to start here, but it's all tied up with the same
>> > problem
>> > I think.
>> >
>> > hex2bin produces a binary character string, but I'm not sure that it can be
>> > stored into a character field in php driver as that seems to baulk at a
>> > '00'
>> > character, while PHP doesn't? What I would like to be able to do is
>> > simply store
>> > the 8 byte string as a BIGINT but I'm not sure how to handle that.
> Not sure I've understand all, but do you mean a field with CHARACTER SET
> OCTET would solve?

Probably part of the equation, but I have had problems in the past with the
normal '00' character being used to terminate strings.

I can remember having to switch mechanisms and not use normal strings but use a
buffer with a fixed length to pass pure binary data. When we have a fixed length
string this is more managable, and I know I can pass binary data such as .jpg
files to a blob, but I'm not sure how to switch between simple '00' terminated
strings and pure binary data that has a separate length field ...

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?

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