繁体   English   中英

无法使加载数据文件生效

[英]Cannot get Load Data Infile To Work

这是我的LOAD DATA脚本。 我无法正常工作。 任何人对我的工作有任何认识吗? 谢谢!

$sql = "
LOAD DATA INFILE ".$theFile."
REPLACE INTO TABLE Product
FIELDS TERMINATED BY '|'
LINES TERMINATED BY '\n'
(archived_id_number, sku, name, upc, account_id, shippingBox_id, unit_cost, supplier_id, description, productLength, productWidth, productHeight)";

这是我的txt文件的示例:

 43485|7850|Cool Circuits|630227078508|74||10.00|545||0.00|0.00|0.00
 39682|7802|Light|630227078027|74||10.00|545||0.00|0.00|0.00

这是我得到的错误:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '/home/hallow8/public_html/xxxx/scripts/productsNew2/data_science_wiz.txt' at line 1

您需要在路径两边加引号

$sql = "
LOAD DATA INFILE '".$theFile."'
REPLACE INTO TABLE Product…

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM