We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 44718
    • 10 Posts
    Hi all,

    I have a question about joins.

    I am making a website for my soccerclub. So i have a custom table with an automatic soccerinformation generator. This puts gamestats en comeptition stats in de database.

    With MIGXdb i made a view from teams where i need to connect a team to a specific competition. 1 team can have more competion(regular and cup) and 1 competition can have only 1 team.

    Now my question is. What is the best way of joining these tables and getting the overview.

    I think i need 3 tables:

    1 table with the competition information
    1 table with the teams
    1 table to make all the 1 to many and many to 1 joins.

    Can anyone help me to setting this up? I am really stuck at the moment, with the join for the teams and competition. i can't get it work for a many to one link and the other way around.

    Hope to hear from someone soon. If you dont understand mys tory, i apologize. Give me your questions and i will answer them.

    Greeting,

    Kevin
      • 16551 ☆ A M B ☆
      • 54 Posts
      You could define a composite and an aggregate alias for this in your XML-schema:
      http://rtfm.modx.com/xpdo/2.x/getting-started/creating-a-model-with-xpdo/defining-a-schema/defining-relationships

      I'm not sure if you really need a third table for this. This depends on what you want to do, e.g. if you want to use the same teams in the next season again...