getting fields from a related table of a related table

A place for users and developers of the Xataface to discuss and receive support.

getting fields from a related table of a related table

Postby cookie720 » Thu Jun 28, 2012 6:32 pm

i have three tables, client, case, and appointment

my clients are related to case
my appointments are related to case
one client to a case, many appointments to a case
the problem is getting the client info in appointments.
i can get the case info in each appointment, but i cant get the client.

im guessing its in the appointments relationships.ini

[cases]
cases.CaseID = "$CaseID"

[clients]
__sql__ ="SELECT * FROM `clients` now what? "

the cases works, the client....not sure how to get the client....is it even possible? I have all clients appearing now in the related section. I just want the one that is related to the case. is it possible to get it "through" the case?
cookie720
 
Posts: 69
Joined: Mon Jun 04, 2012 9:22 pm

Re: getting fields from a related table of a related table

Postby shannah » Wed Jul 04, 2012 10:22 am

This is trickier, as your clients relationship probably won't be able to add/remove related records how you like. But you can set up the relationship and see what happens. You just need to do a many to many relationship:
Code: Select all
[clients]
    cases.CaseID="$CaseID"
    clients.ClientID=cases.ClientID
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: getting fields from a related table of a related table

Postby cookie720 » Wed Jul 04, 2012 10:49 pm

Shannah, ThankYOU! that worked, chucked that into my ini and it works. Can get clients in my appointment pdf!
perfect-o
cookie720
 
Posts: 69
Joined: Mon Jun 04, 2012 9:22 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 13 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved