If I stored values as S5001:31,32,33|S5002:42,44,46|S5003:21,23,25... etc.
in database, how to retrieve the values using implode function so that I can display the marks separately to find total for each registered number in HTML table?
$internalmark_col="mark_internal";
$student_internal_marks_array = array();
if(isset($student_internal_mark->$internalmark_col))
{
$internalmarks_stud_code_arr=explode(',',$student_internal_mark->$internalmark_col);
foreach($internalmarks_stud_code_arr as $marks_each)
{
$internalcode_mark=explode(':',$marks_each);
if(isset($internalcode_mark[0]) && isset($internalcode_mark[1]))
$student_internal_marks_array[$internalcode_mark[0]]=$internalcode_mark[1];
}
}
print_r($student_internal_marks_array);
exit;
For above code I got wrong output. Desired output is:
Register No | Mark 1 | Mark 2 |Mark 3 | Total
-------------------------------------
S5001 | 3 | 2 | 3 | 8
S5002 |4 | 4 |6 | 14
S5003 |1 |3 |5 | 9
serialize?