Need help with Pear::DB_DataObjects
| From: | Clements, Brent M \(SAIC\) | Date: | Wed, 19 Apr 2006 18:18:41 +0000 |
| Subject: | Need help with Pear::DB_DataObjects | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-23750@lists.php.net to get a copy of this message | ||
I'm having trouble figuring out the addJoin method of DB_DataObjects
I have the following two tables
table1: vertrans_ID, install_ID, site_ID, ntlogin
table2: install_ID, chgcat_ID, aim_ID, app_ID, and so on
(note the "install_ID" field in both tables, install_ID IS the primary key in table2)
When I do:
$model['versionsArray'] = array();
DB_DataObject::debugLevel(5);
$t1 = DB_DataObject::Factory('table1');
$t2 = DB_DataObject::Factory('table2');
$t2->app_ID = "1";
$t2->joinAdd($t1, NULL, NULL , "install_ID");
DB_DataObject::debugLevel();
But when I run that query, the DataObjects Debugger says that table1 has no link with table2
I've checked the RAW SQL and I get the expected results when I run the SQL via the Database
command line client. Am I forming the DataObjects version of the query wrong? I'm trying to
achieve the following RAW sql
SELECT
*
FROM
table1 ,
table2
WHERE
table2.app_ID = '1 AND
table2.install_ID = table1.install_ID
Can someone please indicate where my error is at?
Thanks,
BC.
This message may contain confidential and/or privileged information. If you are not the addressee
or authorized to receive this for the addressee, you must not use, copy, disclose, or take any
action based on this message or any information herein. If you have received this message in error,
please advise the sender immediately by reply e-mail and delete this message. Thank you for your
cooperation.