-1

我无法解决这个问题:

$data=array(
for($i=1; $i<=$tot+1; $i++){    

array(                  

'id_jenisjadwal' => $this->input->post('jenis_jadwal'),

'bulan_tahunkp' => $bln_thn,

'id_ruang' => $this->input->post('ruang'.$i),

'tgl_sidangkp' => $this->input->post('tgl'.$i),

'jam_awalkp' => $this->input->post('awal'.$i),

'jam_akhirkp' => $this->input->post('akhir'.$i)

)
});
$this->db->update_batch('jadwal_kp',$data,'id_jenisjadwal'); 
4

2 回答 2

1

您正在执行一个循环,其中数组的定义应该存在。

$data=array();

  for($i=1; $i<=$tot+1; $i++){  

   $data[$i] = array(                  

 'id_jenisjadwal' => $this->input->post('jenis_jadwal'),

 'bulan_tahunkp' => $bln_thn,

'id_ruang' => $this->input->post('ruang'.$i),

 'tgl_sidangkp' => $this->input->post('tgl'.$i),

'jam_awalkp' => $this->input->post('awal'.$i),

'jam_akhirkp' => $this->input->post('akhir'.$i)

 );
}
于 2013-07-08T13:16:22.907 回答
0

黑暗中的野刺==

$data = array();

for($i=1; $i<=$tot+1; $i++){

$data[] = array(

your data bits in the middle .......

);

}
于 2013-07-08T13:16:39.210 回答