My Codeigniter Model Code is below
$last_qt_pk_id = "";
$i = 0;
foreach($query->result() as $row){
$data [] = $row;
$rq_pk_id = $row->id;
$question_type_pk_id = $row->question_type_pk_id;
if($question_type_pk_id != $last_qt_pk_id){
$i =1;
} else {
++$i;
}
$up_data = array('receive_serial_ato_qt'=>$i);
$this->db->where('id',$rq_pk_id);
$this->db->update('qms_received_question_info',$up_data);
$last_qt_pk_id = $question_type_pk_id;
}
My Above Code Firstly it do update, then the question list display in view.
My Code is working nicely but sometimes the problem/error is showing.
My Error is given below by image
I cannot understand that why is showing the error sometimes. If i restart xampp then it has ok for some time but after some time then the error is showing again. I have tried with wamp and xampp but it is showing same problem.
Please, any help?