想知道如果有人能找到这个错误:你在你的SQL语法错误
$sqlinsert = "LOAD DATA LOCAL INFILE
\'$target_path\' INTO TABLE 'db_usergroup'
FIELDS TERMINATED BY \',\' ENCLOSED BY \'\"\' ESCAPED BY \'\\\\\'
LINES TERMINATED BY \'\\r\\n\'";
$target_path
在其确切的名称略有不同,但一个例子是:
temp/24_09_12_16_57_27_invoice_example.csv
我得到这个错误:
An error occurred. The file could not be imported.
Error with MySQL Query: 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
'\'temp/24_09_12_16_57_27_invoice_example.csv' INTO TABLE
'db_usergroup' FIELDS T' at line 1
所有帮助是非常感谢。
使生活更轻松,而且不易出错,使用定界符语法。 http://php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc –