Home » RADICORE » How To » list2 not respecting list1 key
|
|
Re: list2 not respecting list1 key [message #729 is a reply to message #728] |
Fri, 30 March 2007 13:12   |
rgervais
Messages: 7 Registered: March 2007
|
Junior Member |
|
|
Hmm those sample tables work right. I did not add any code to the function. It looks pretty much like the samples.
$outer_table = 'period'; // name of outer (parent) table
$inner_table = 'log'; // name of inner (child) table
$screen = 'log.list2.screen.inc'; // file identifying screen structure
require 'std.list2.inc'; // activate page controller
I decided I would try again in a new subsystem, all fresh and new. When I hit the popup on the jrn table in a create relationship, I get:
Fatal Error: pg_query() [function.pg-query]: Query failed: ERROR: 42703: column "column_count" does not exist LOCATION: transformColumnRef, parse_expr.c:396 (# 256).
SQL query: SELECT count(*) FROM dict_table LEFT JOIN dict_column ON (dict_table.database_id=dict_column.database_id AND dict_table.table_id=dict_column.table_id) WHERE dict_table.database_id='it' GROUP BY dict_table.database_id, dict_table.table_id, dict_table.table_desc HAVING column_count > 0
Error in line 295 of file '/srv/www/htdocs/radicore/includes/dml.pgsql.class.inc'.
Host Info: localhost, Server Version: 8.1.4
Client Encoding: UTF8, Server Encoding: LATIN1
Database: RADICORE, Schema: "DICT", PUBLIC
Script: /radicore/dict/table_popup.php
Request URI: /radicore/dict/table_popup.php?session_name=menu3
I'm not sure how I added them in the past, but clear other stuff is wrong.
|
|
|
|
|
|
|
|
|
|
Re: list2 not respecting list1 key [message #1852 is a reply to message #728] |
Sat, 15 November 2008 07:32   |
David Lee
Messages: 44 Registered: June 2006
|
Member |
|
|
I have this same problem appearing. Select a couple of items from a list1, then list2 display, and all records are displayed. Cause the query to be repeated, by changing sort order, or the next selected item from the list1, and the display is then correct.
The WHERE is completely dropped from the first screen, as seen in the mysql statements saved into physicalkey_b(list2).php I have included all that trace below, which also shows the other queries for look-up tables, and menu/user control, and added a few comments.
***** /njc/physicalkey_b(list2).php 2008-11-15 12:14:17
SELECT SQL_CALC_FOUND_ROWS * FROM mnu_control WHERE record_id='SYSTEM' AND field_id LIKE 'SHUTDOWN%' ORDER BY record_id, field_id =>Count=10
***** /njc/physicalkey_b(list2).php 2008-11-15 12:14:59
SELECT SQL_CALC_FOUND_ROWS * FROM mnu_control WHERE record_id='SYSTEM' AND field_id LIKE 'SHUTDOWN%' ORDER BY record_id, field_id =>Count=10
SELECT SQL_CALC_FOUND_ROWS field_id, initial_value, is_noedit FROM mnu_initial_value_user WHERE user_id='DNL' AND task_id='njcphysicalkey_b(list2)'
ORDER BY user_id, task_id, field_id =>Count=0
SELECT SQL_CALC_FOUND_ROWS field_id, initial_value, is_noedit FROM mnu_initial_value_role WHERE role_id='GLOBAL' AND task_id='njcphysicalkey_b(list2)'
ORDER BY role_id, task_id, field_id =>Count=0
SELECT SQL_CALC_FOUND_ROWS field_id, initial_value, is_noedit FROM mnu_initial_value_user WHERE user_id='DNL' AND task_id='njcphysicalkey_b(list2)'
ORDER BY user_id, task_id, field_id =>Count=0
SELECT SQL_CALC_FOUND_ROWS field_id, initial_value, is_noedit FROM mnu_initial_value_role WHERE role_id='GLOBAL' AND task_id='njcphysicalkey_b(list2)'
ORDER BY role_id, task_id, field_id =>Count=0
SELECT SQL_CALC_FOUND_ROWS location.* FROM location WHERE ( location.location_id='19' ) OR ( location.location_id='36' ) ORDER BY location.location_
name asc LIMIT 1 OFFSET 0 =>Count=2
The last line above shows the keys for the two selected items
SHOW COLUMNS FROM location LIKE 'organisation'=>Count=,JFC,The Deco,Administration
SELECT SQL_CALC_FOUND_ROWS physicalkey.*, keytype.user_name, location.location_name FROM physicalkey LEFT JOIN keytype ON (keytype.keytype_id=physicalk
ey.fkkeytype_id) LEFT JOIN location ON (location.location_id=physicalkey.fklocation_id) LIMIT 10 OFFSET 0 =>Count=595
No WHERE in the last line, so many results
SELECT SQL_CALC_FOUND_ROWS location_id, CONCAT(location_name,' ' , location_type) FROM location ORDER BY location.location_type =>Count=54
SELECT SQL_CALC_FOUND_ROWS keytype_id, CONCAT(marking, ' ', user_name ) FROM keytype ORDER BY keytype.sortorder =>Count=121
SELECT SQL_CALC_FOUND_ROWS role_id,global_access FROM mnu_role WHERE role_id='GLOBAL' ORDER BY role_id =>Count=1
SELECT SQL_CALC_FOUND_ROWS x.task_id, x.script_id, x.pattern_id, mnu_nav_button.button_text, mnu_nav_button.context_preselect FROM mnu_nav_button LEFT
JOIN mnu_task ON (mnu_task.task_id = mnu_nav_button.task_id_snr) LEFT JOIN mnu_task AS x ON (x.task_id = mnu_nav_button.task_id_jnr) WHERE mnu_task.t
ask_id='njcphysicalkey_b(list2)' AND (x.is_disabled='N') ORDER BY mnu_nav_button.sort_seq =>Count=5
Now select the next record.
***** /njc/physicalkey_b(list2).php 2008-11-15 12:15:15
SELECT SQL_CALC_FOUND_ROWS * FROM mnu_control WHERE record_id='SYSTEM' AND field_id LIKE 'SHUTDOWN%' ORDER BY record_id, field_id =>Count=10
SELECT SQL_CALC_FOUND_ROWS location.* FROM location WHERE ( location.location_id='19' ) OR ( location.location_id='36' ) ORDER BY location.location_
name asc LIMIT 1 OFFSET 1 =>Count=2
SHOW COLUMNS FROM location LIKE 'organisation'=>Count=,JFC,The Deco,Administration
SELECT SQL_CALC_FOUND_ROWS physicalkey.*, keytype.user_name, location.location_name FROM physicalkey LEFT JOIN keytype ON (keytype.keytype_id=physicalk
ey.fkkeytype_id) LEFT JOIN location ON (location.location_id=physicalkey.fklocation_id) WHERE location.location_id='36' LIMIT 10 OFFSET 0 =>Count=
0
WHERE in the last line limits it correctly, but, for this case, there are no valid records. That is not significant.
SELECT SQL_CALC_FOUND_ROWS location_id, CONCAT(location_name,' ' , location_type) FROM location ORDER BY location.location_type =>Count=54
SELECT SQL_CALC_FOUND_ROWS keytype_id, CONCAT(marking, ' ', user_name ) FROM keytype ORDER BY keytype.sortorder =>Count=121
SELECT SQL_CALC_FOUND_ROWS role_id,global_access FROM mnu_role WHERE role_id='GLOBAL' ORDER BY role_id =>Count=1
SELECT SQL_CALC_FOUND_ROWS x.task_id, x.script_id, x.pattern_id, mnu_nav_button.button_text, mnu_nav_button.context_preselect FROM mnu_nav_button LEFT
JOIN mnu_task ON (mnu_task.task_id = mnu_nav_button.task_id_snr) LEFT JOIN mnu_task AS x ON (x.task_id = mnu_nav_button.task_id_jnr) WHERE mnu_task.t
ask_id='njcphysicalkey_b(list2)' AND (x.is_disabled='N') ORDER BY mnu_nav_button.sort_seq =>Count=5
Now go back to the first key
***** /njc/physicalkey_b(list2).php 2008-11-15 12:15:34
SELECT SQL_CALC_FOUND_ROWS * FROM mnu_control WHERE record_id='SYSTEM' AND field_id LIKE 'SHUTDOWN%' ORDER BY record_id, field_id =>Count=10
SELECT SQL_CALC_FOUND_ROWS location.* FROM location WHERE ( location.location_id='19' ) OR ( location.location_id='36' ) ORDER BY location.location_
name asc LIMIT 1 OFFSET 0 =>Count=2
SHOW COLUMNS FROM location LIKE 'organisation'=>Count=,JFC,The Deco,Administration
SELECT SQL_CALC_FOUND_ROWS physicalkey.*, keytype.user_name, location.location_name FROM physicalkey LEFT JOIN keytype ON (keytype.keytype_id=physicalk
ey.fkkeytype_id) LEFT JOIN location ON (location.location_id=physicalkey.fklocation_id) WHERE location.location_id='19' LIMIT 10 OFFSET 0 =>Count=
4
WHERE in the last line so 4 records, not the 595 earlier ones.
SELECT SQL_CALC_FOUND_ROWS location_id, CONCAT(location_name,' ' , location_type) FROM location ORDER BY location.location_type =>Count=54
SELECT SQL_CALC_FOUND_ROWS keytype_id, CONCAT(marking, ' ', user_name ) FROM keytype ORDER BY keytype.sortorder =>Count=121
SELECT SQL_CALC_FOUND_ROWS role_id,global_access FROM mnu_role WHERE role_id='GLOBAL' ORDER BY role_id =>Count=1
SELECT SQL_CALC_FOUND_ROWS x.task_id, x.script_id, x.pattern_id, mnu_nav_button.button_text, mnu_nav_button.context_preselect FROM mnu_nav_button LEFT
JOIN mnu_task ON (mnu_task.task_id = mnu_nav_button.task_id_snr) LEFT JOIN mnu_task AS x ON (x.task_id = mnu_nav_button.task_id_jnr) WHERE mnu_task.t
ask_id='njcphysicalkey_b(list2)' AND (x.is_disabled='N') ORDER BY mnu_nav_button.sort_seq =>Count=5
|
|
|
|
|
|
|
Goto Forum:
Current Time: Fri Jun 20 16:01:02 EDT 2025
Total time taken to generate the page: 0.09623 seconds
|