Re: Dataobject : complex jointures

From: Date: Tue, 26 Jul 2005 18:39:43 +0000
Subject: Re: Dataobject : complex jointures
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-20153@lists.php.net to get a copy of this message
On 7/26/05, David Alia <david.alia@gmail.com> wrote: > > > > I must be an idiot but I can't get to do it : > > > > when I write : > > > > $D->selectAdd('A1, A2, A3, E1'); > > > > I get an error (unknown column E1) > > >>Does the E1 column exist? Is the join of E working? Try > >>DB_DataObject::debugLevel(1) to see the SQL that is generated and any > errors that may be happening. > > Yep, E1 exists. I've checked with debugLevel up to 5. The SQL select does > not include "E" tables so it's not working... > Then your joinAdd to E is not working. Do you perhaps see an error when you do $B->joinAdd($E) with debugging turned on? Are you sure you set up the links right (no typos)? > > > > when I write : > > > > $D->selectAs($E, 'E_%s'); > > > > I get an error (D has no link with E) > > > > I've tried lots of possibilities but nothing comes... > > > > >> Perhaps I was wrong about selectAs. I've never actually used it myself.. > ;-) I tend to just use selectAdd. > > >> $D->selectAdd('A.A1, A.A2, A.A3, E.E1, E.E2, B.B1, etc...'); > > I've tried this too. But, like the previous one, E table is not in the > query, I get an SQL error. > I've worked on a workaround (getting all infos from A, B, C and D first, > then looking for fields from E. Not great but...) > > Thanks a lot for your help. If you think about a solution (during the night > maybe ? :)), feel free :-) > > David > > -- > Justin Patrin > > -- Justin Patrin

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