Show several data from two tables that have a field in common

Show several data from two tables that have a field in common

crije22crije22 Posts: 7Questions: 3Answers: 0
edited August 2018 in Free community support

Hello friends!
I have the following situation I have a table about some tours. where the reservation information of the person is displayed.

I have a button of details that opens a modal with more information and a desgloce of the tours that will take

I get this information from two different tables one for the reservation information and another one for the details have a common idreservation field

Sometimes a reservation can have more than one tour so I can show in the details modal, each one the tours

would be with a loop or there are other alternatives

thank you , for all the contributions

Answers

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    Hi @crije22 ,

    I'd be tempted to have two Ajax calls - one to get the information for the main table (so just the reservation information), and a second call that's initiated when the details button is pressed (which returns the more detailed information). Separating the two means that you can get the format exactly as you want.

    Bet there's many other ways to go though :)

    Cheers,

    Colin

  • crije22crije22 Posts: 7Questions: 3Answers: 0

    thanks for the answer @colin , in a single call ajax get all the data I need.

    but when I want to show part of the tours, it only shows me one even if it has more than one.

    Thanks again

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    Ah, I thought you were after advice on the design. Best bet then is to create a kid e example or link to your page so we can see it...

    C

This discussion has been closed.