我在mysql_query語句正上方迴應了聲明,出於某種原因,csv文件中的斜線正在被剝離?我收到你可以在下面看到的錯誤。任何見解?PHP mysql_query自動剝離斜線?
echo "LOAD DATA LOCAL INFILE '" . $csv . "' INTO TABLE mytable FIELDS TERMINATED BY ',' LINES TERMINATED BY '\r\n' IGNORE 1 LINES";
mysql_query("LOAD DATA LOCAL INFILE '" . $csv . "' INTO TABLE mytable FIELDS TERMINATED BY ',' LINES TERMINATED BY '\r\n' IGNORE 1 LINES") or die(mysql_error());
錯誤:
LOAD DATA LOCAL INFILE 'C:\FileClean\output\6eai1mikqkidpe1re77e8a6jn2trial_new.csv' INTO TABLE mytable FIELDS TERMINATED BY ',' LINES TERMINATED BY ' ' IGNORE 1 LINES Can't find file 'C:FileCleanoutput6eai1mikqkidpe1re77e8a6jn2trial_new.csv'
ü可以給我們帶來什麼'$ csv'等於或它的一個例子嗎? – Henesnarfel 2012-02-16 20:21:33
你是否躲過了斜線?即「\\」 – MysticXG 2012-02-16 20:21:48
喲可以看到$ csv等於上面回覆的語句中(右下方的「錯誤」) – 2012-02-16 20:22:49