php - how to generate students mark ledger from 3 tables- Student,Mark,Subject -



php - how to generate students mark ledger from 3 tables- Student,Mark,Subject -

i have 4 tables 1.student-it contains id name etc 2.marks - contains markid,student_id,batch,class,section,subject_id,exam_id,obt_mark 3.subject table - contains sub_id,sub_name 4. exam_type- examtype_id, exam_name need mark ledger batch-2014,class=5,section=1,exam_id=3 shown below-

name roll no sub1 sub2 sub3 total result position rank ram 0054 65 54 64 183 pass first 2 hari 0054 65 54 65 184 pass first 1 gopal 0054 65 50 65 180 pass first 3 saroj 0054 65 44 65 174 pass first 4

thanks in advance .

here have sql query

select `marklists`.`mrk_sub_id1`, `marklists`.`mrk_marks`, `marklists`.`mrk_practical`, `marklists`.`mrk_exam_type`, `students`.`id` st_id, `students`.`st_roll`, `students`.`st_name`, `students`.`batch`, `students`.`st_class`, `students`.`st_section`, `courses`.`id`, `classes`.`class_name` class_name, `courses`.`sb_name` subject_name, `courses`.`sb_fullmark` full_marks, `courses`.`sb_passmark` pass_marks (`marklists`) left bring together `classes` on `marklists`.`mrk_class` = `classes`.`id` left bring together `students` on `marklists`.`mrk_student_id`=`students`.`id` left bring together `courses` on `marklists`.`mrk_sub_id`=`courses`.`id` `marklists`.`mrk_exam_type` = '3' , `marklists`.`mrk_batch` = '3' , `marklists`.`mrk_class` = '1' , `marklists`.`mrk_section` = '1'

and need ledger above help??

join tables based on mutual key , titles need subject can utilize pivot operator convert rows column , utilize clause rest of conditions hope helps.

php mysql sql database report

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -