无法获取加载数据Infile工作 [英] Cannot get Load Data Infile To Work

查看:101
本文介绍了无法获取加载数据Infile工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的LOAD DATA脚本。我不能让它工作。任何人都有我的能做什么?谢谢!

Here is my LOAD DATA script. I cannot get it to work. Any one have any heads up on what I can do? Thanks!

$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文件的示例:

Here is what and example of my txt file(s) looks like:

 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

get:

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


推荐答案

您需要在路径周围加引号

You need quotes around the path

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

这篇关于无法获取加载数据Infile工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆