//我的模型test.php如下
public function saveallpars($id)
{
$config['upload_path'] = sys_get_temp_dir();
$config['allowed_types'] = 'txt';
$config['xss_clean'] = false;
$config['overwrite'] = true;
$config['return_temp_file'] = true;
$this->load->library('upload', $config);
if (!$file = $this->upload->do_upload())
{
$error = array('error' => $this->upload->display_errors());
dd($error);
}
else
{
$contents = explode("\n", file_get_contents($file));
$this->data= serialize($contents);
$this->db->where(array('id' => $id))->set(array('data' =>$this->data))->update($this->_table);
}
我正在尝试将文本文件的内容保存在数据库字段“ data”中。但是它没有保存。任何帮助将不胜感激。