Re: Search for field in related table [message #1788 is a reply to message #676] |
Wed, 05 November 2008 03:23 ![Go to previous message Go to previous message](/theme/default/images/up.png) ![Go to next message Go to previous message](/theme/default/images/down.png) |
rhogan
Messages: 4 Registered: November 2008 Location: Wolfeboro, NH
|
Junior Member |
|
|
AJM wrote on Tue, 13 March 2007 13:20 | The contents of $where ($sql_where) is filtered to remove any columns which do not exist in the current table. If you are joining to other tables then search criteria for these other tables can be placed inside $this->sql_search using code inside the _cm_pre_getData() method. The contents of $this->sql_search has a different filter mechanism.
|
Could you provide a specific example of this? What code goes in which file?
For instance, I've got 2 tables with a one-to-many relationship, one person to many phone numbers.
I'd like to add phone number to the search screen for person in a drop down. So the user who has a phone number can find out what person it belongs to. In other words, I want to do a search on the senior table, based on a value in the junior table, and I need to have that field appear for input on the senior table search screen.
This seems like it should be simple, but I've been working through the tutorial for at least a week and I just can't find the solution. I can't have a user pick the person before getting to phone, because, that's what they would be searching for.
Thanks,
Boz
[Updated on: Wed, 05 November 2008 03:27] Report message to a moderator
|
|
|