Subject Re: [firebird-support] Weird php and firebird problem, repeating values
Author Fabio Gomes
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.

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

Maybe i just just send the server flying out of the window -_-

On 12/12/05, Lester Caine <lester@...> wrote:
>
> Fabio Gomes wrote:
>
> > I dont think so, i used the same function for years with mysql and i use
> the
> > same code with a LOT of firebird code, and just with THIS table i have
> this
> > problem.
>
> And I STILL think it is due to using '*' !
> Obviously one of the un-named fields that is being returned is giving a
> problem. So the starting point is always to check the ACTUAL fields that
> you want returned ;)
>
> > I already tried to change my code to:
> >
> > $var = ibase_query($id, $sql);
> >
> > while($results = ibase_fetch_assoc($var)) {
> > echo $results['blablabla'];
> > }
> >
> > but i get the same repeated values :(
>
> So drop the '*' in that and try adding known field names until the
> problem returns then we will know WHAT is causing the problem.
>
> > i ve tried a lot of things, but none have worked, but in the ibwebadmin
> my
> > query return the correct value :(
> >
> > But if you wanna see my code, i ve posted it here:
> >
> > http://www.phpbuilder.com/board/showthread.php?t=10313979
>
> I would be starting but dropping a print_r($items); after consulta() and
> checking what the array is actually populated with, but testing things
> in isolation above would be a better starting point :)
>
> --
> Lester Caine
> -----------------------------
> L.S.Caine Electronic Services
> Treasurer - Firebird Foundation Inc.
>
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> 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
>
>
> - Visit your group "firebird-support<http://groups.yahoo.com/group/firebird-support>"
> on the web.
>
> - To unsubscribe from this group, send an email to:
> firebird-support-unsubscribe@yahoogroups.com<firebird-support-unsubscribe@yahoogroups.com?subject=Unsubscribe>
>
> - Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service <http://docs.yahoo.com/info/terms/>.
>
>
> ------------------------------
>


[Non-text portions of this message have been removed]