Re: DB_DataObject->joinAdd
| From: | Ian Warner | Date: | Wed, 26 Jul 2006 08:23:49 +0000 |
| Subject: | Re: DB_DataObject->joinAdd | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-24767@lists.php.net to get a copy of this message | ||
Hi at the bottom of this page is a join example that may help you.
http://wiki.triangle-solutions.com/index.php/PEAR_DB_DataObject
Regards
Ian Warner
Director
Triangle Solutions Ltd
http://www.triangle-solutions.com/
Noel da Costa wrote:
Hi there, I'm using this syntax for joinAdd: $dataObject =& DB_DataObject::factory('person'); $foreignTable = 'role'; $foreignColumn = 'role_id'; $dataObject->joinAdd(array($key,$foreignTable.':'.$foreignColumn)); which gives the following SQL: JOIN role ON role.role_id=person.role_id I'm trying (and failing) to change the "person." part before the last "role_id" I need this to match a different table (personrole), rather than the primary (person) table. How do I make this change within the systax for joinAdd? Thanks, Noel da Costa Lead Developer www.magharl.co.uk