DB_Dataobject and complex joins

From: Date: Wed, 19 May 2004 15:23:55 +0000
Subject: DB_Dataobject and complex joins
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-12616@lists.php.net to get a copy of this message
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'); $radUser->joinAdd($radCheck, 'LEFT', 'radcheck'); 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 (#12616) next »