This topic is locked

Searching Multiple Detail Tables

12/13/2021 11:48:52 PM
PHPRunner General questions
J
JoeB7774 author

I am looking through the following article and am wondering how I would search three different detail tables that are all linked to one master table. Would I create three different search criteria?

https://xlinesoft.com/phprunner/docs/search_master_and_details_tables_together.htm

J
JoeB7774 author 12/13/2021

Also, how would I expand the detail records when the search is conducted.

Sergey Kornilov admin 12/14/2021

Yes, you will need multiple search criteria. I recommend to craft the required SQL query manually first so you have a better understanding of how it should work. Then you can build something similar in your code.

J
JoeB7774 author 12/15/2021

Sounds great. I will get started. When I use the search field (before modifying the search criteria), the identified results are highlighted in red. Once I started experimenting with the additional search criteria, that functionality disappeared. Should that functionality (red highlighting) remain even if I alter the search criteria?

fhumanes 12/16/2021

Hello:

As I resolve it is quite simple.

I recover all the fields from the main table and then I do "Left Join" with the dependent auxiliary tables where to recover all the values I use the "group_concat" function, which puts me all the values in a single field with a separating character.

This fields with grouped information, do not show it but if I use it in the general search, with what the problem is solved.

If I did not explain well, I can make a little example so that it is easy to understand.

Greetings,
fernando