0
我有数组我想插入数据库中的值使用codeigniter,我不知道如何插入,我试图但我无法得到答案如何在数据库中使用每个循环的数组值插入
我的模型
的print_r($ subjectHandling);
Array
(
[subjectId] => Array
(
[0] => 1
[1] => 2
)
)
现在我想在这个值插入数据库中的值。
我想这样
foreach($subjectHandling as $key=>$value) {
$reg_dat = array(
'statffId' => '1',
'subjectId' => $value,
);
$this->db->insert("subject_handling" , $reg_dat);
}
我米得到错误**数组到字符串转换**,所以如何做到这一点。我想在DATABSE