1
public function save_edit() {
parent::__save_edit();
$this->db = $this->load->database('default', true);
$this->load->model('product_model','',TRUE);
$id = $this->input->post('item_id');
$array_item = array(
'item_name' => $this->input->post('item_name'),
'note' => $this->input->post('item_note'),
'stock' => $this->input->post('item_stock'),
'price' => $this->input->post('item_price'),
'unit' => $this->input->post('item_unit')
);
$this->load->model('product_model');
$this->product_model->update($id,$array_item);
redirect('index.php/product');
}
public function edit(){
$this->db = $this->load->database('default', true);
$this->load->model('product_model');
**$data['product'] = $this->product_model->product($this->uri->segment(3))->row_array();**
$this->load->view('index.php/product_edit',$data);
}
$data['product'] = $this->product_model->product($this->uri->segment(3))->row_array();
게시글은 대부분 코드이므로 일부 정보를 추가하십시오. –
제품 모델 코드를 표시하십시오. 응용 프로그램과 관련이없는 버전 태그를 편집하고 제거하십시오. – Tpojka
오류가 무엇을 말하고 있는지 파악하는 데 천재는 필요하지 않습니다. 제품 모델에 제품 방법이 있거나없는 경우이 오류는 그렇지 않다고 말합니다. 너는 무엇을 기대하고 있니? –