Re: DB_Dataobject and complex joins

From: Date: Wed, 19 May 2004 17:16:41 +0000
Subject: Re: DB_Dataobject and complex joins
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-12627@lists.php.net to get a copy of this message
Quoting Alan Knowles <alan@akbkhome.com>:
$radUser =& DB_DataObject::factory('Radacct'); $radCheck =& DB_DataObject::factory('Radcheck');
     $radCheck->Attribute = 'Password';
$radUser->joinAdd($radCheck, 'LEFT', 'radcheck');
'should' Do it... I tried this :) Perhaps I should have mentioned that in my first email. The result of that is as follows: SELECT count(radacct.RadAcctId) as DATAOBJECT_NUM FROM radacct LEFT JOIN radcheck ON radcheck.UserName=radacct.UserName WHERE radcheck.Attribute = 'Password' This actually gives different results from this. (which is what I'm after) SELECT * FROM radacct LEFT JOIN radcheck ON radcheck.Username = radacct.Username AND radcheck.Attribute = 'Password' Notice the last of the WHERE clause. Thanks for your help again AK! Kind Regards, Ian

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