Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE development » Transaction Patterns » Link Pattern (Additional Data of the 'Parent Field')
Link Pattern (Additional Data of the 'Parent Field') [message #7293] Sun, 19 May 2019 07:18 Go to next message
htManager is currently offline  htManager
Messages: 435
Registered: May 2014
Senior Member
I have a link table and I want to show the data of the 'Parent Field' of the ONE TABLE - configured in the Parent Relationship - in the screen. What is wrong with my relationship? Or is there a better way?
Re: Link Pattern (Additional Data of the 'Parent Field') [message #7294 is a reply to message #7293] Mon, 20 May 2019 04:18 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2369
Registered: April 2006
Location: Surrey, UK
Senior Member
If you are using the LINK1 pattern this references three tables - $outer, $link and $inner. Which one of these three do you mean?

Re: Link Pattern (Additional Data of the 'Parent Field') [message #7295 is a reply to message #7293] Mon, 20 May 2019 06:56 Go to previous messageGo to next message
htManager is currently offline  htManager
Messages: 435
Registered: May 2014
Senior Member
I do need data of the $outer and $inner tables. Therefore I configured the 'Parent Field' in the $link table as these fields as you can see here:

// parent relationship details
$this->parent_relations[] = array('parent' => 'training_kanal',
'parent_field' => 'training_kanal_name',
'fields' => array('training_kanal_id' => 'training_kanal_id'));

$this->parent_relations[] = array('parent' => 'training_kanal_uebungskategorie',
'parent_field' => 'training_kanal_kategorie_desc',
'fields' => array('training_kanal_id' => 'training_kanal_id',
'training_kanal_kategorie_id' => 'training_kanal_kategorie_id'));

I want to show only the 'true' records with the id-descriptions (training_kanal_name and training_kanal_kategorie_desc), stored in the $outer and $inner tables.

And here is the code of the php file:

$outer_table = 'training_kanal_uebungen'; // name of outer table
$link_table = 'training_kanal_uebungen_kategorie'; // name of link table
$inner_table = 'training_kanal_uebungskategorie'; // name of inner table
$screen = 'training_kanal_uebungen_kategorie.link1(u).screen.inc'; // file identifying screen structure

// customise the SQL SELECT statement
$outer_sql_select = null;
$outer_sql_from = null;
$outer_sql_where = null;
$outer_sql_groupby = null;
$outer_sql_having = null;
$outer_sql_orderby = null;
$outer_sql_orderby_table = null;

$link_sql_select = null;
$link_sql_from = null;
$link_sql_where = 'training_kanal_uebungen_kategorie.training_kanal_uebung_no = ' .
'training_kanal_uebung_no '; // .
$link_sql_groupby = null;
$link_sql_having = null;
$link_sql_orderby = 'training_kanal_kategorie_desc';
$link_sql_orderby_table = null;
$link_search_table = 'training_kanal_uebungskategorie';

require 'std.link1.inc'; // activate page controller

Re: Link Pattern (Additional Data of the 'Parent Field') [message #7296 is a reply to message #7295] Tue, 21 May 2019 04:53 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2369
Registered: April 2006
Location: Surrey, UK
Senior Member
In order to see examples of how you can modify the SQL query please take a look at menu/mnu_menu(link1).php and menu/mnu_nav_button(link1).php

Re: Link Pattern (Additional Data of the 'Parent Field') [message #7297 is a reply to message #7293] Tue, 21 May 2019 15:37 Go to previous message
htManager is currently offline  htManager
Messages: 435
Registered: May 2014
Senior Member
Thank you for your hint. I now get the data from the inner table but I am still struggling with a left join on an additional table. But I now have the result I wanted. And I understand again a little bit more. Thank you.

[Updated on: Tue, 21 May 2019 16:23]

Report message to a moderator

Previous Topic: IDE Validation Issues
Next Topic: SQL error generating list2 pattern
Goto Forum:
  


Current Time: Mon Nov 25 11:22:14 EST 2024

Total time taken to generate the page: 0.01144 seconds