Re: using LIKE and JOIN in select queries using DataObject?
| From: | Justin Patrin | Date: | Thu, 30 Dec 2004 20:10:04 +0000 |
| Subject: | Re: using LIKE and JOIN in select queries using DataObject? | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-16527@lists.php.net to get a copy of this message | ||
On Wed, 29 Dec 2004 05:55:15 -0800 (PST), l Burnerheimerton
<lburnerheimerton@yahoo.com> wrote:
> I am learning to use DataObject so any help is appreciated.
>
> I'd like to transform the two following queries into something DataObject can use and
> understand:
>
> SELECT f_ID, f_Name FROM f_j_o WHERE fName LIKE '%" . $POST['fN'] .
> "%'"
>
> SELECT f.f_ID, o.fName FROM fgle f, f_join o Where f.l_ID = " . $SESSION['u_ID']
> . ""
>
> I've created the dataobject files and the links.ini file.
>
> Thanks for any ideas of how to transforming these to usable DataObject queries is MUCH
> appreciated
>
Well, you can use getLink to get the linked dataobject.
$f_j_o->get('fName', 'Frank');
$f_join = $f_j_o->getLink('columnWhichLinksTo_j_join');
Or you can use joinAdd() to do the join.
--
Justin Patrin