title icon 學務系統交流網
menu_top_background
:::
體適能統計查詢問題
:::

體適能管理模組的統計查詢功能出現問題畫面 : 


1.在「身高以上 %」等的查詢時,出現:

SQL語法錯誤  程式目前執行位置:/var/www/html/sfs3/modules/fitness/admin.php 的第 222 行 


2.在「坐姿前彎 %」等的查詢時,出現:
SQL語法錯誤  程式目前執行位置:/var/www/html/sfs3/modules/fitness/admin.php 的第 336 行


經檢視 更新記錄 發現 2006/12/30 曾將 體適能資料表 欄位stud_id更改為student_sn
故程式中的查詢SQL應跟著改變,舉例說明:

原本(錯誤版):

select  b.seme_class,count(*) as cou,avg(c.tall) as a_tall ,avg(c.weigh) as a_weigh ,avg(c.bmt) as a_bmt ,avg(c.test1) as a_test1 ,avg(c.test2) as a_test2 ,avg(c.test3) as a_test3 ,avg(c.test4) as a_test4 from stud_base a,stud_seme b ,fitness_data c where a.stud_id=b.stud_id  and c.stud_id=a.stud_id  and c.stud_id=b.stud_id  and (a.stud_study_cond=0 or a.stud_study_cond=5) and  b.seme_year_seme='0951'and  c.c_curr_seme='0951'

更正後(正確版):

select  b.seme_class,count(*) as cou,avg(c.tall) as a_tall ,avg(c.weigh) as a_weigh ,avg(c.bmt) as a_bmt ,avg(c.test1) as a_test1 ,avg(c.test2) as a_test2 ,avg(c.test3) as a_test3 ,avg(c.test4) as a_test4 from stud_base a,stud_seme b ,fitness_data c where a.student_sn=b.student_sn  and c.student_sn=a.student_sn  and c.student_sn=b.student_sn  and (a.stud_study_cond=0 or a.stud_study_cond=5) and  b.seme_year_seme='0951'and  c.c_curr_seme='0951'

經修正後已經能正確統計查詢所有體適能資料...

menu_bottom_background

::: copy right: 苗栗縣政府教育處資訊中心
建議使用瀏覽器Firefox或Chrome