0
codeigniterでupdate_batchを使用して複数のレコードを更新しようとしていますが、動作しません。アクティブレコードを使用してcodeigniterの複数のレコードを更新する
$this->db->update_batch('road_map',$data,'id');
Idはwhere
条件の配列でなければなりません。ここに私のコード
public function update {
$id = $this->input->post('id');
$id_sumber = $this->input->post('id_sumber');
$nominal = $this->input->post('nominal');
$jumlah = count($id);
$data = array();
for ($x=0; $x< $jumlah; $x++){
$data[] = array(
'id' => $id[$x],
'id_sumber' => $id_sumber[$x],
'nominal' => $nominal[$x]
);
}
$this->db->update_batch('road_map',$data,'id');
}
そこにエラーがありますか? – hassan
あなたの質問にid配列を表示 – rahulsm