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

Home » RADICORE development » Transaction Patterns » PopUp - Link1 table
Re: PopUp - Link1 table [message #5572 is a reply to message #5567] Thu, 26 May 2016 12:58 Go to previous messageGo to previous message
htManager is currently offline  htManager
Messages: 415
Registered: May 2014
Senior Member
I read FAQ08 and FAQ84 but I struggle all day long with the SQL syntax and I don't know what I am doing wrong. I try to improve my SQL skills (as you suggested) but this is at the moment obiously too much for me.

This component script of the popup2 will show no entries.

$outer_table = 'training_plan_uebungskategorie'; // name of outer (parent) table
$inner_table = 'training_plan_uebungen_kategorie'; // name of inner (child) table
$screen = 'training_plan_uebungen_kategorie.popup2.screen.inc'; // file identifying screen structure

// customise the SQL SELECT statement
$outer_sql_select = null;

$inner_sql_select = null;
$inner_sql_from = 'training_plan_uebungen_kategorie '
. 'LEFT JOIN training_plan_uebungen ON ('
. 'training_plan_uebungen.training_plan_uebung_no = training_plan_uebungen_kategorie.u_training_plan_uebung_no AND '
. 'training_plan_uebungen.rdcaccount_id = training_plan_uebungen_kategorie.u_rdcaccount_id) ';
$inner_sql_where = null;

require 'std.list2.popup.inc'; // activate page controller

The following error message and the SQL statement will be shown if the default sort order of the link table is a field value of one of the parent tables (linked with a relationship).

Fatal Error: MySQL: Unknown column 'training_plan_kategorie_desc' in 'order clause' (# 1054)

SQL query: SELECT SQL_CALC_FOUND_ROWS * FROM training_plan_uebungen_kategorie LEFT JOIN training_plan_uebungen ON (training_plan_uebungen.training_plan_uebung_no = training_plan_uebungen_kategorie.u_training_plan_uebung_no AND training_plan_uebungen.rdcaccount_id = training_plan_uebungen_kategorie.u_rdcaccount_id) WHERE

training_plan_uebungen.rdcaccount_id='1'

AND training_plan_uebungen_kategorie.k_training_plan_kategorie_i d='ABW-GRDU' AND training_plan_uebungen_kategorie.k_rdcaccount_id='1' ORDER BY training_plan_kategorie_desc asc LIMIT 10 OFFSET 0

The expression "training_plan_uebungen.rdcaccount_id='1'" is obviously inserted by the framework. If I change the values of rdcaccount_id to 1, the records will not be shown.
Do I have to change the where clause, too?
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Filepicker - choose Null button
Next Topic: List view (List3)
Goto Forum:
  


Current Time: Mon Apr 29 09:32:14 EDT 2024

Total time taken to generate the page: 0.01661 seconds