Subject Re: [firebird-support] Weird php and firebird problem, repeating values
Author Lester Caine
Fabio Gomes wrote:

> OMG!
>
> Finally after fighting agains this thing the whole day.. i found the STUPID
> problem.
>
> All those fields that were repeating, had something in comon, they werent
> NULL, they where BLANK, so i did this:
>
> UPDATE CLIENTES SET CLI_LIM_CREDITO = NULL WHERE CLI_LIM_CREDITO ='';
> UPDATE CLIENTES SET CLI_OBS = NULL WHERE CLI_OBS ='';
> UPDATE CLIENTES SET CLI_CEP = NULL WHERE CLI_CEP ='';
> UPDATE CLIENTES SET CLI_CNPJ_CPF = NULL WHERE CLI_CNPJ_CPF ='';
> UPDATE CLIENTES SET CLI_IE_RG = NULL WHERE CLI_IE_RG ='';
> UPDATE CLIENTES SET CLI_DDD = NULL WHERE CLI_DDD ='';
> UPDATE CLIENTES SET CLI_TELEFONE = NULL WHERE CLI_TELEFONE ='';
> UPDATE CLIENTES SET CLI_CELULAR = NULL WHERE CLI_CELULAR ='';
>
> Then i ran they script again... and now everything is fine, i never think
> that it could be the problem, as am used to work with mysql, and in mysql
> blank = null, so i never imagined that the problem would be so STUPID!

MySQL does not return NULL properly so if you try and use it in generic
database stuff you get problems the other way round ;)
The NULL states get handled correctly in ADOdb so I don't have that
problem, and ibWebAdmin is probably processing them as well. You SHOULD
have seen 'NULL' in the arrays printed out when you were looking at the
faulty output.

> Btw.. thanx guys for you patience with a stupid newbie like me, you helped
> me a lot, now i m gonna set ALL my fields as NULL by default.

? NOT NULL - I always populate strings to '', for the simple reason that
I may want to do SELECT CLI_TELEFONE || ',' || CLI_CELULAR and that
returns NULL if either is not defined.

> Thanx a lot, now i can rest in peace :)

We all have bad days :)

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