This is my data table1. I want this table change to as a table2. I have to use PHP for this. I wrote the some code using foreach but that is not working properly. C
This would be your table design: (https://jsfiddle.net/vg3whzvq/2/)
SeqNo
Student Id
maths
art
Exam 1
Exam 2
Exam 1
Exam 2
1
200301
51
25
64
45
Now to display the data with php you can do something like that:
$output .= "
SeqNo
Student Id
maths
art
Exam 1
Exam 2
Exam 1
Exam 2
";
$studentCounter = 0;
foreach($result as $item)
{
$output .= "
" . ++$studentCounter . "
" . $item[STUDENT_ID] . "
" . $item[MATHS_EXAM_1] . "
" . $item[MATH_EXAM_2] . "
" . $item[ART_EXAM_1] . "
" . $item[ART_EXAM_2] . "
";
}
$output .= "
";
It now depends on how your $result
looks like.