php - Codeigniter missing argument -
help guys.
this error problem error:
i think follow right tutorial, don't know wrong code
there controllers
public function edit($id){ $where = array('id' => $id); $data['barang'] = $this->model_barang->edit($where,'barang')->results(); $this->load->view('edit',$data); } public function update(){ $id = $this->input->post('id'); $jenis = $this->input->post('jenis'); $nama = $this->input->post('nama'); $harga = $this->input->post('harga'); $pemasok = $this->input->post('pemasok'); $data = array ( 'jenis' => $jenis, 'nama'=> $nama, 'harga' => $harga, 'pemasok' => $pemasok ); $where = array( 'id' => $id ); $this->model_barang->update($where,$data,'barang'); redirect('barang/tampil'); }
and there model, think model not showing error
public function edit($where,$table) { return $this->db->get($table,$where); } public function update($where,$data,$table){ $this->db->where($where); $this->db->update($table,$data); }
you need pass $id controller. should http://domain.com/barang/edit/1
Comments
Post a Comment