错误看起来是这样的:MySQL错误,同时更新
未知列 '在' resignation_id ='158 'where子句'
UPDATE pr_temporary_absconding_checklists SET completion_status = 'pending' WHEREresignation_id='158' AND checklist_id='4'
我的模型代码:
function submit_absconding_checklist($post_array, $idss) {
$this->load->database();
$ids = $this->uri->segment(4);
$where = "resignation_id='$ids' AND checklist_id='$idss'";
$this->db->where($where);
$dbdata = array(
"completion_status" => $post_array['completion_status']
);
$this->db->update('pr_temporary_absconding_checklists', $dbdata);
print_r($query);
die;
/**
* if required add this code here to check
*
* echo $this->db->last_query();
*/
return 'Checklist updated successfully';
}
放错位置的反引号〜似乎是围绕所有的“resignation_id =‘158’”反引号 – RamRaider
你的表告诉你正在使用resignation_id1代替resignation_id的。 更改它。 – Manish
@Manish是什么?这是正确的。 –