Re: Need help with Pear::DB_DataObjects
| From: | bertrand Gugger | Date: | Wed, 19 Apr 2006 18:27:37 +0000 |
| Subject: | Re: Need help with Pear::DB_DataObjects | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-23752@lists.php.net to get a copy of this message | ||
Bonsoir,
Don't you miss some link.ini file ?
something like :
[table2]
install_ID = table1:install_ID
<quote href="http://pear.php.net/manual/en/package.database.db-dataobject.intro-relations.php"> DB_DataObject Version 0.3 introduced the ability to create link ini files so you can map column to other database columns using an ini file this ini file should have the name 'databasename.links.ini', and be placed in the same folder as the database schema ini file 'databasename.ini' file that is created automatically by createTables.php</quote>
Regards
--
toggg
Clements, Brent M (SAIC) wrote:
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 * FROMtable1,table2WHEREtable2.app_ID= '1 ANDtable2.install_ID=table1.install_IDCan 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.