i want to ask my program.
I wanted to edit but can not be edited in the table jurnal while in table bahan\_baku successfully edited.
please save me.
i have 2 tabel.

table bahan\_baku
id\_bahanbaku
keterangan\_bb
tanggal\_bb
jumlah\_bb
harga\_bb

table jurnal
id\_jurnal
id\_coa
tanggal
debet
kredit

this my model -> m\_bahanbaku.php

```
function m_edit($data_bb){
    $this->db->where($data_bb);
    $edit_bb = $this->db->get('bahan_baku');
return $edit_bb->result();

    $this->db->where($data_jurnal);
    $edit_jurnal = $this->db->get('jurnal');

return $edit_jurnal->result();
}
function m_update($data_bb, $id_bahanbaku,$data_jurnal, $id_coa){
    $this->db->where('id_bahanbaku', $id_bahanbaku); //untuk tabel bahan_baku
    $this->db->update('bahan_baku', $data_bb);
    $this->db->where('id_jurnal', $id_jurnal); //dari tabel jurnal
    $this->db->update('jurnal', $data_jurnal);

```

}
} 

and this my controller -> bahanbaku.php

```
 function edit($id_bahanbaku){
    $data_bb=array(
        'id_bahanbaku'=>$id_bahanbaku
        );
    $data_jurnal=array(
        'id_jurnal'=>$id_bahanbaku
        );  
    $data_bb['data_edit']=$this->m_bahanbaku->m_edit($data_bb, $data_jurnal);
    $this->load->view('keuangan/v_edit_bb',$data_bb, $data_jurnal);
 }
 function update(){
    $id_bahanbaku = $this->input->post('id_bahanbaku');
        $data_bb=array(
        'keterangan_bb' => $this->input->post('keterangan_bb'),
        'tanggal_bb' => $this->input->post('tanggal_bb'),
        'jumlah_bb' => $this->input->post('jumlah_bb'),
        'harga_bb' => $this->input->post('harga_bb')

        );
    $id_jurnal = $this->input->post('id_jurnal');
         $data_jurnal=array(
         'tanggal' => $this->input->post('tanggal_bb'),
         'debet'=>$this->input->post('harga_bb'),
         'kredit'=>$this->input->post('harga_bb')
         );
        $this->m_bahanbaku->m_update($data_bb, $id_bahanbaku, $data_jurnal, $id_jurnal);
        redirect(base_url().'keuangan/bahanbaku/lihat');
 }
}

```