I have a table student attendance.
Fields/data sample
id | studid | cls_id | smonth | syear | total_p | total_a
1 | 20 | 2 |
I think u just want to update each record of total_p and total_a column just make it simple:
//get the id of student
$student_id = Input::get('student_id');
$present = Input::get('status'); //dropdown value 0,1
//You need a model for your table let say:
#Student.php
count() && $status==1 ){ //status 1 = present
$query->total_p += 1; //plus one value in the total_p column in the tbl.
$query->save();
}else{
$query->total_a +=1;
$query->save();
}
}