Subject | Re: [firebird-php] BIGINT & PHP |
---|---|
Author | Lester Caine |
Post date | 2004-04-17T19:16:56Z |
Lutz Br|ckner wrote:
strings as well.
My understanding is that in PHP integer will be 64 bit on 64 bit
platforms, but on 32 bit platforms numbers greater than 32 bit will be
converted to float, with a 14 digit accuracy. (Now that I've had a look ;) )
I had better start keeping an eye on sizes :)
--
Lester Caine
-----------------------------
L.S.Caine Electronic Services
>>[Alan McDonald] Where do you actually experience the problems - I mean whatOK - I've been insulated a little by ADOdb, which handles these as
>>tasks are you carrying out when you get an error caused by this issue?
>
> It was when I used something like
>
> $sql = sprintf('INSERT INTO SOMETABLE (BINGINT_FIELD) VALUES (%d)',
> $bigint_value);
>
> The %d represents an integer in the sprintf-syntax and so 2147483647 was
> inserted if $bigint_value was a bigger number. Replacing %d with %s
> solved the problem.
>
> There is no problem with fetching BIGINT values from a table because the
> ibase_fetch_xxx() functions returning them as strings.
strings as well.
My understanding is that in PHP integer will be 64 bit on 64 bit
platforms, but on 32 bit platforms numbers greater than 32 bit will be
converted to float, with a 14 digit accuracy. (Now that I've had a look ;) )
I had better start keeping an eye on sizes :)
--
Lester Caine
-----------------------------
L.S.Caine Electronic Services