This topic is locked

Combining 2 tables

7/30/2008 4:59:51 PM
PHPRunner General questions
author

I have 2 tables in my database and I want the first table to come up with all of the jobs listed and when you select a job to view it goes to the information from the second table. seems easy enough but how do you do this in phprunner?
I have the first table just fine but right now you have to go to the menu for the second table and then pick the job to go to the view.

Thanks for your help

Patti

A
alang 7/30/2008

Set the first table up as master and second as detail - see datasource tables tab and the link "what are master-detail relationships"

500434 7/31/2008

thanks for the reply but I tried that and I don't think (could be wrong) that's what I want.
What I want to have happen is that the list page show for one table and then when you click view you go to the view for the second table... does that make sense or is that a no way?

Patti

A
alang 7/31/2008

Yes, you can do that - one way is to make your main view a combination of your two tables on the SQL tab - create a join between them and include the fields you want for both tables. You can then select which fields you include in the "List" and "View" pages. It can get a bit tricky editing and saving data back to the right table - you will need some PHP code in the events to do that. The other question is why do you have two tables - why not combine all of the data into one table?

500435 7/31/2008

I think you'e right. I just need one table. when I started I didn't see that phprunner lets you turn on and off items in different view.

thanks for the help. It's starting to look like something.

Patti