Page 1 of 1

How to display many fields matching 1 id

Posted: 2019-06-17 17:00
by bhardison
I'm SURE this is in the forum somewhere and I just don't know the correct terms to search for it. So please be kind to this AppGini/ SQL newbie :oops:

I have 2 tables. 1 is a client info table client_info and the other is domain_info. We lease websites to professional clients based on their areas of expertise. I'll use truck sales as an example. 1 client may lease websites on multiple domains for example: vintagepickups.com gmcworld.com world-o-trucks.com, etc all attached to a single id. In my online view of client_info I would like to display all of the domains assigned to his/her id in the domain_info table.

In phpmyadmin I can use

Code: Select all

SELECT `domain` FROM `domain_info` WHERE `lease_client` = '1260' 
to display a single id's domains. The 1260 exists in the id field in client_info table and as lease_client field in domain_info.

How would I do something similar for the described results for all clients?

Thanks in advance for any help / examples / tutorials you can send my way.

Bill

Re: How to display many fields matching 1 id

Posted: 2019-07-02 15:33
by onoehring
Hi

does't it work by default? When you have a lookup field in your domain_info table where you select the client_info primary key?
When you then select the client in the "overview" table, you will get his details and below those details all entries from domain_info that carry his primary key.

Olaf