I am so close, but I just can't quite grasp this! Some hand-holding would be appreciated 
I have Fred. Fred owns Store A and Store B. Store A has Truck 1. Store B has Truck 1 and Truck 2.
We track deliveries for each truck individually, with each truck having a unique 'ID' in the clients table (clients.ID). I would like to loop my code in such a way that I can get query results for just Truck 1 or 2, or for Store B (which would include Truck 1 and 2) or Store A, or for Fred himself, which would include both stores and all trucks.
I know this isn't as hard as I'm making it out to be. A good push in the right direction, or outright code, would be greatly appreciated! I'm going thin on details, sorry. Not to be too verbose:
MID is the 'master ID', or the client that 'owns' the client. Any client with an MID of '0' will be the top owner (ie, "Fred"
.
Sorry if this is a badly formed post. Long day at work ;-)
----
JBR

I have Fred. Fred owns Store A and Store B. Store A has Truck 1. Store B has Truck 1 and Truck 2.
We track deliveries for each truck individually, with each truck having a unique 'ID' in the clients table (clients.ID). I would like to loop my code in such a way that I can get query results for just Truck 1 or 2, or for Store B (which would include Truck 1 and 2) or Store A, or for Fred himself, which would include both stores and all trucks.
I know this isn't as hard as I'm making it out to be. A good push in the right direction, or outright code, would be greatly appreciated! I'm going thin on details, sorry. Not to be too verbose:
Code:
Table: clients
| ID | MID | full_name |

Sorry if this is a badly formed post. Long day at work ;-)
----
JBR