rollno subject marks 1 english 98 2 english 90 3 english 83 1 maths 89 2 maths 75 3 maths 67 1 physics 76 2 physics 68 3 physics 59
rollno english maths physics 1 98 89 76 2 90 75 68 3 83 67 59
$data['subjects'] = $mmodel->distinct() ->select('b.id as subjectid, b.subject') ->join('tblsubjects b','b.id = tblexammarks.subjectid','left') ->where('examid',$examid)->findAll(); $data['marks'] = $mmodel->select('rollno,subjectid,(theory_marks + viva_marks) as obmarks') ->where('examid',$examid) ->orderBy('rollno') ->findAll(); return view('exammarks/exmarksbysubs',$data);
<table class="table table-striped table-bordered"> <tr> <td>Rollno</td> <?php if (isset($subjects)) { foreach($subjects as $row1){ ?> <td><?=$row1['subject'];?></td> <?php } }?> </tr> foreach($marks as $row) { <td><?=$row['rollno']; </td> <td><?= $row['obmarks']; ?> </td> </tr> <?php } ?> </table>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)