Subject Re: [firebird-php] Numeric (and very strange) Error...
Author Lester Caine
gustavo_0002000 wrote:

> I'll try to explain my proplem as clear as posible... English isn't my
> native language so i'll do my best...
> I have 2 aplications... One DELPHI v7 coded using IBX v7.01 controls
> and one made in PHP runing on APACHE v2 and PHP v5.0.2...
> My server is FIREBIRD 1.5RC2. (I was using initially IB 6.01)

1.5.2 is the current version, and 1.5.3 is about to be released! IB6.01
was never a stable option.

> The database was originaly generated and initially populaten running
> on IB 6.01...
> Ok... Here is the thing...
> In one table I have a NUMERIC(15,8) field. (This happens in all
> NUMERICS or DECIMALS)... Not in Floats or Integers.
> When accesing the records in DEPLHI everything is fine... When
> accesing in PHP I have this strange problem, here is an example:
> In then DB is stored the value 325000.00000000
> Delphi returns the value ok... (IBExpert shows me the values OK too.)
> PHP returns 32500.00000000 (Ten times less)

I presume that if you ADD values from PHP, then they go in correctly? So
if you put 325000 in, it reads as 325000 in PHP, but 3250000 in Delphi?

> This is very stange to me... One some long ago I had the same problem
> when trying to recompile in DELPHI 2005 the exact same code as the D7
> aplication I had a similar error... (That time I thought about the
> D2005 IBX implementation)
> It could be because the original DB and the original Delphi App where
> "expecting" to work with the older IB DB?...
> The PHP problem is new, because I was using PHP 4.2 and the same exact
> App runned fine (until the upgrade of PHP, this morning)...

So you get different answers between PHP4 and PHP5?

> I don't want give up this time (as I wrongly did with D2005)... I want
> to know whats happening because this is too stange...
> Maybe the problem with the gds32.dll. (I replaced all those in my PC
> with the Firebird ones).

You should always use the latest gds32.dll - you ARE using the Firebird
one, and not the one supplied with PHP ( that should be removed ! )

> I'm open to any kind of sugestion... I did a lot of things trying to
> correct this, but I'm not putting my "tryings" here because those
> explanations will make this post even more confusing.
> Ok... I'm in your hands now... Of course I'm still working on this...

Have you tried running ibWebAdmin on your machine and seeing what that
does. I am rushing to get out of the door to a customer's site so I
can't check myself - but I will do later !

Lester Caine
L.S.Caine Electronic Services
Treasurer - Firebird Foundation Inc.