Re: Dataobject : complex jointures

From: Date: Tue, 26 Jul 2005 17:32:16 +0000
Subject: Re: Dataobject : complex jointures
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-20147@lists.php.net to get a copy of this message
On 7/26/05, David Alia <david.alia@gmail.com> wrote: > > Hi. Thanks a lot for your -so quick- help. > > [cut] > > > > > $D->selectAdd(); > > $D->selectAdd('A1, A2, A3'); // fields from A table > > > > $B->joinAdd($E); > > > > $D->joinAdd($B); > > $D->selectAs(); > > >>Likely the above call is killing the A selectAdds from above. Try removing > the above line and see what you get. > > --> this solved the problem : A fields are now available. > > > > > - SQL statement does not include A fields, nor E fields > > >> The A fields are missing likely due to the first selectAs call. The E > fields aren't showing up because you didn't ask for them. Perhaps try a > selectAs call for A, B, *and* E. > > --> Ok, I thought I had already selected E fields using $B->joinAdd($E) ? > Since, E has no link with D, I canno't write $D->joinAdd($E)... > Joining is not the same as setting up selected fields. joinAdd simply adds a join clause to your SQL. You empty out the SELECT part when you do selectAdd(), so no fields except the ones you specify will be shown. Try a selectAs for all 3 and see if that works. -- Justin Patrin

« previous php.pear.general (#20147) next »