Re: DB_Dataobject and complex joins

From: Date: Wed, 19 May 2004 16:32:42 +0000
Subject: Re: DB_Dataobject and complex joins
References: 1  Groups: php.pear.general php.pear.general 
Request: Send a blank email to pear-general+get-12622@lists.php.net to get a copy of this message
Ian P. Christian wrote:
I am trying to get DB_Dataobject to construct the following query. SELECT * FROM radacct LEFT JOIN radcheck ON radcheck.Username = radacct.Username AND radcheck.Attribute = 'Password' however, using this code... $radUser =& DB_DataObject::factory('Radacct'); $radCheck =& DB_DataObject::factory('Radcheck');
    $radCheck->Attribute = 'Password';
$radUser->joinAdd($radCheck, 'LEFT', 'radcheck'); 'should' Do it... Regards Alan
which produces... SELECT count(radacct.RadAcctId) as DATAOBJECT_NUM FROM radacct LEFT JOIN radcheck ON radcheck.UserName=radacct.UserName is the closest I can get. Is it possible to achive this? I've been trying for some time, but I am unable to figure it out. I've looked though the source code for DB_Dataobject::joinAdd, but still couldn't figure it out. Any help appreciated :) Kind Regards, Ian


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