RE: [PEAR] Dataobject : complex jointures

From: Date: Tue, 26 Jul 2005 18:32:57 +0000
Subject: RE: [PEAR] Dataobject : complex jointures
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-20150@lists.php.net to get a copy of this message
> > 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... > > 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

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