从中添加值
$data_name['file_name']
在foreach循环之后,执行insertbatch。
类似于:
$filename_arr = array();
foreach ($_FILES as $key => $value) {
if (!empty($value['tmp_name']) && $value['size'] > 0) {
if (!$this->upload->do_upload($key)) {
// some errors
} else {
// Code After Files Upload Success GOES HERE
$data_name = $this->upload->data();
$filename_arr[] = $data_name['file_name'];
}
}
}
$this->db->insert_batch('mytable', $filename_arr);