我正在加载数据文件,我已经得到了这个代码
move_uploaded_file($file_temp,"uploads/master_listing/".$file_name);
$file_path = FCPATH.'/uploads/master_listing/'.$file_name;
$this->db->query("LOAD DATA LOCAL INFILE '".$file_path."'
INTO TABLE fsi_temp_newmasterlist
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
IGNORE 1 LINES
(SEQUENCENUMBER,NAME,ADDRESS,PICKUPDATE,ENCODERNO,BARCODEVALUE,REMARKS,CLIENT,PROD)
");
我不知道代码中有什么问题,我得到了错误Can't find file
这是我的文件位置myfolder/uploads/master_listing/
我的csv文件有表头SEQUENCENUMBER,NAME,ADDRESS,PICKUPDATE,ENCODERNO,BARCODEVALUE,REMARKS,CLIENT,PROD
使用
$new_name = str_replace("\","/",$file_path)
替换后C:/xampp5.5/htdocs/joel_fsi/fsi2/uploads/master_listing/testfileupload.csv
在你的代码
C:xampp5.5htdocsjoel_fsifsi2/uploads/master_listing/testfileupload.csv
它们是冲突的和
/
查看Codeigniter路径函数定义