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

Home » RADICORE » How To » list2 not respecting list1 key
Re: list2 not respecting list1 key [message #1852 is a reply to message #728] Sat, 15 November 2008 07:32 Go to previous messageGo to previous message
David Lee is currently offline  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

 
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: Update1 problem
Next Topic: Intranet Application
Goto Forum:
  


Current Time: Thu Nov 28 00:15:44 EST 2024

Total time taken to generate the page: 0.01273 seconds