This topic is locked

Searching a field from a dependent table without using a join

9/26/2006 1:14:06 PM
PHPRunner General questions
J
jcottrell author

(PHPRunner 3.1)
In the list view of a master table, I want to select records by searching text from fields in detail tables. If I edit the SQL query to make joins, as per the help topic "Using JOIN SQL queries", this adds the fields OK, but my list page for the master table now has multiple entries for each record because the master - detail relationships are one to many. What's the best way to add fields to the search list without this side-effect?
(Its a complex table structure, and the add, edit, view pages are handled by code I've added into events)
Wonderful product, by the way!

Alexey admin 9/27/2006

Hi,
unfortunatelly there is no easy way to do this.
You can modify generated ..._list.php file and change SQL WHERE criteria used for seacrhing to search in detail tables as well. You need to be familiar with PHP to do that.
Here are the places in ..._list.php file you need to modify.

if(@$_SESSION[$strTableName."_search"]==1)

{

...

// simple search SQL string is produced here

...

}

else if(@$_SESSION[$strTableName."_search"]==2)

{

...

// advanced search SQL string is produced here

...

}