Subject Re: [firebird-support] Weird php and firebird problem, repeating
Author Steve Wiser
Do you have to alias the table names in a join?

-steve

Werner F. Bruhin wrote:
> Hi Fabio,
>
> Shouldn't this:
> JOIN CIDADES ON (CLIENTES.CID_COD=CIDADES.CID_COD)";
>
> not be:
> JOIN CIDADES ON (CLIENTES.CLI_COD=CIDADES.CID_COD)";
> ^^^
>
> See you
> Werner
>
>
> Lester Caine wrote:
>
>> We still don't know which version of PHP you are working with?
>> The PHP5 Interbase driver had a lot of work which was never back ported
>> to PHP4 :(
>>
>> Fabio Gomes wrote:
>>
>>
>>
>>> I dont know what more i can try, if i do this:
>>>
>>> $sql = "SELECT C.CLI_COD,
>>> C.CLI_NOME,
>>> C.CLI_ENDERECO,
>>> C.CLI_BAIRRO,
>>> C.CLI_CEP,
>>> C.CLI_LIM_CREDITO,
>>> C.CLI_CNPJ_CPF,
>>> C.CLI_IE_RG,
>>> C.CLI_DDD,
>>> C.CLI_TELEFONE,
>>> C.CLI_CELULAR,
>>> C.CLI_OBS,
>>> CIDADES.CID_NOME,
>>> CIDADES.CID_ESTADO
>>> FROM CLIENTES C
>>> JOIN CIDADES ON (CLIENTES.CID_COD=CIDADES.CID_COD)";
>>>
>>> #$clientes = consulta($conexao_id, $sql);
>>> $clientes = ibase_query($conexao_id, $sql);
>>> while($cli = ibase_fetch_row($clientes)) {
>>> print_r($cli) . "<br /><br />";
>>> }
>>>
>>> It return me the SAME value.
>>>
>> With some of the fields? - C.CLI_COD and C.CLI_NOME are still OK but no
>> others?
>>
>>
>>
>>> If i take off the JOIN on the query, it still repeat the results.. the query
>>> just works like this:
>>>
>>> $sql = "SELECT C.CLI_COD,
>>> C.CLI_NOME,
>>> C.CLI_ENDERECO,
>>> C.CLI_BAIRRO,
>>> C.CLI_CEP,
>>> C.CLI_LIM_CREDITO,
>>> CIDADES.CID_NOME,
>>> CIDADES.CID_ESTADO
>>> FROM CLIENTES C
>>> JOIN CIDADES ON (CLIENTES.CID_COD=CIDADES.CID_COD)";
>>>
>>> If i remove the last fields (that are those wich are repeating) the query
>>> works.. but it doesnt solve my problem...
>>>
>> So the problem is one of
>> > C.CLI_CNPJ_CPF,
>> > C.CLI_IE_RG,
>> > C.CLI_DDD,
>> > C.CLI_TELEFONE,
>> > C.CLI_CELULAR,
>> > C.CLI_OBS,
>>
>> Is it JUST one of those fields?
>> In which case what type of field is it and what should be in it?
>>
>>
>>
>>> Maybe i just just send the server flying out of the window -_-
>>>
>> Just wasted 2 hours trying to work out why a program would not run in
>> the Borland Debugger - turns out that there was a dll missing from XP
>> that is present in W2k. I just had not twigged that I'd not worked on
>> that program since I had to move laptops and the new one refused to
>> install W2k - because the BIOS was too *OLD*.
>>
>> Got some other contacts pulling hair out over MySQL 4.0 and 4.1 - how do
>> you backport a database since the software NOW fails on the later
>> versions of MySQL.
>>
>> So the sledge hammer next to the equipment rack is standard practice ;)
>>
>>
>
>
>
>
>
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://firebird.sourceforge.net and click the Resources item
> on the main (top) menu. Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
>
>