문제는이 모델에 있습니다. where
문을 제거하면 쿼리가 올바르게 실행되지만 id에 따라 행을 하나 변경하려면 Where 문이 필요합니다. where 문을 가지고 쿼리를 실행할 때 데이터베이스에는 아무런 영향을 미치지 않지만 영향을받는 행은 없습니다.Codigniter 업데이트 쿼리가 작동하지 않습니다.
public function update_goods()
{
$id=$this->input->post('ID');
$data=array(
'ID'=>$this->input->post('ID'),
'Title'=>$this->input->post('Title'),
'Value'=>$this->input->post('Value'),
'Description'=> $this->input->post('Description'),
);
$this->db->where('ID', $id);
$this->db->update('goods',$data);
}
$ id를 에코하려고하십시오. 신분증을 받고 있습니까? –
echo $ this-> db-> last_query(); - 업데이트 쿼리가 끝나면이 작업을 시도하십시오. –