I have two tables being used in a database:
1) registration_main - This table contains a traveler's primary information, such as address, phone, etc, and has a primary index field of "regmain_id"
3) registration_people - This table contains individual traveler information, such as legal name, date of birth, gender, etc. There is a field in this table named "regpeople_regmain_id" which is in a one-to-many relationship with "regmain_id" from #1 above. Basically, a person can register any number of individual travelers (#2) within their main account (#1).
I have created a CC list displaying records from "registration_main". I want to create a link in each row of the list that, when clicked, will open a CC list displaying the records from "registration_people" that match record clicked (registration_main.regmain_id = registration_people.regpeople_regmain_id).
I am fairly confused in how to accomplish this.
1) registration_main - This table contains a traveler's primary information, such as address, phone, etc, and has a primary index field of "regmain_id"
3) registration_people - This table contains individual traveler information, such as legal name, date of birth, gender, etc. There is a field in this table named "regpeople_regmain_id" which is in a one-to-many relationship with "regmain_id" from #1 above. Basically, a person can register any number of individual travelers (#2) within their main account (#1).
I have created a CC list displaying records from "registration_main". I want to create a link in each row of the list that, when clicked, will open a CC list displaying the records from "registration_people" that match record clicked (registration_main.regmain_id = registration_people.regpeople_regmain_id).
I am fairly confused in how to accomplish this.
I have been able to do this by creating a link on each record in the connection list for "registration_main", which includes a url parameter "regid = regmain_id", which opens the connection list for "registration_people".
The "registration_people" connection list contains the following in the WHERE clause:
This setup will open the second connection properly. It seems, however, that there may be an easier way.
The "registration_people" connection list contains the following in the WHERE clause:
<?php
$url = JURI::getInstance()->toString();
$url_parts = parse_url($url);
parse_str($url_parts['query'], $path_parts);
$recid = $path_parts['regid'];
echo "`regpeople_regmain_id` = '$recid'";
?>
This setup will open the second connection properly. It seems, however, that there may be an easier way.
Hi Rick,
I did something similar recently but used a Custom Listing to create the list and built the links in the Body box.
Bob
I did something similar recently but used a Custom Listing to create the list and built the links in the Body box.
Bob
Bob,
Yeah, I am using a custom list. I always do, just given the greater flexibility it affords. The method I came up with works, but I just feel there must be an easier way - one that I am missing. Perhaps not. Max did such a great job with making these tools easy to use!!
Rick
Yeah, I am using a custom list. I always do, just given the greater flexibility it affords. The method I came up with works, but I just feel there must be an easier way - one that I am missing. Perhaps not. Max did such a great job with making these tools easy to use!!
Rick
This topic is locked and no more replies can be posted.