• Hi, I really like the look of dbview. I would love to be able to use it better.
    I have multiple tables, which can be seen here: https://matthewpetty.com/theatrics/theatre-database/list-of-all-theatre-groups/
    The password is “dbview”

    The tables represent my amateur theatrical career. One table shows theatres, another shows theatre groups, another shows roles etc.

    Each table has a unique ID in one of the columns, so it should be easy to link.

    What I would love to do is show a list of theatres, and to be able to click on a theatre and see a list of performances at that theatre. Similarly, I want to show a list of groups, click on a group and show a list of performances with that group.

    I’ve tried to understand the FAQ, but I can’t seem to get it to work. I don’t understand what I need to do.

    What should I put in the view SQL definition, the dbview tag, the args. Where would I put the PHP?

    I would be very grateful if you could walk me through this.

    Best regards,
    Matthew

    https://www.ads-software.com/plugins/dbview/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author john ackers

    (@john-ackers)

    You should be able to do that. But I cannot see your tables. I get a second authorization dialogue box after entering the password.

    Thread Starter matthewpetty

    (@matthewpetty)

    Hi John, thanks for the response. I’ve made the page public now, so you should be able to see the tables and all the columns.

    At the very least, I want to show a list of Performances, including links to the Group, and then when I click on the Group, it shows info about that Group, along with a list of Performances with that Group.

    Once I can get that working, it should become clearer.

    Thanks for your help,
    Matthew

    Thread Starter matthewpetty

    (@matthewpetty)

    Hi, I’ve been taking another look at this, and I’m getting somewhere with the PHP snippets and concat and so on.

    I’ve seen in the FAQ that you can load a new table with a link, but it looks like that will only open one view. What I would like to do is click a link in a table in one Page, and have a new Page open, which contains two or more views, all filtered by a value passed in the link.

    So my link would be:
    <a href="xxx?group_id">Group Name</a>
    which would open a Page containing the following views:

    [dbview name='Group Details' arg1=group_id]
    [dbview name='Shows List' arg1=group_id]

    Is that possible?

    By the way, all my tables are here: https://matthewpetty.com/theatrics/theatre-database-mysql-all-tcv-tables/

    Thread Starter matthewpetty

    (@matthewpetty)

    This is the new link to the raw data tables.
    https://matthewpetty.com/theatrics/tdb-home/tdb-all-tcv-tables/

    Plugin Author john ackers

    (@john-ackers)

    I haven’t tried doing this but I’d suggest creating the new page with the two or more views that you want. In the position of the two views you’d want to add some PHP that will read and parse the QUERY_STRING and extract the arguments for example using parse_str, then call dbview with those arguments, in your case the group_id. You could use do_shortcode to call dbview.

    If you don’t want to put bits of PHP in your page, you could another plugin like post snippets.

    So using a modified version of one of your examples, the link would be
    <a href="xxx?group_id=bedford+dramatic+club">Bedford Dramatic Club</a> Hope this helps.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Linking tables together to show related records’ is closed to new replies.