This topic is locked

Search Including Detail Data

4/10/2007 5:33:07 PM
PHPRunner General questions
M
mrphp author

Hello,
I have created a business contacts database that has 2 tables, "company" and "contacts". I used phpRunner to create a page that shows the company name and address and then a detail view that lists contact names and email addresses under each company name. Now, if I'm in the company view and do a search, only the "company" table is searched. If I know a person's name but don't remember the company I don't have a way to search it. What I would like is for the detail table (contacts) to be searched at the same time the company table is searched. Is this possible?

Sergey Kornilov admin 4/10/2007

I would create an additional Custom View that pulls data from both tables (INNER JOIN).

select ...

from company

inner join contacts

on company.id = contacts.companyid


This will give you an option to search both tables at the same time.