|
我在PHPMYADMIN中SQL执行这条语句没问题的。
[PHP]SELECT *
FROM step2
INTO OUTFILE 'c:/out.txt'
FIELDS TERMINATED BY '~~'
ESCAPED BY '\\'
LINES TERMINATED BY '\r\n'[/PHP]
我在PHP里面写
[PHP]$outfile= mysql_query("SELECT *
FROM step2
INTO OUTFILE 'c:/out.txt'
FIELDS TERMINATED BY '~~'
ESCAPED BY '\\'
LINES
TERMINATED BY '\r\n'
")
[/PHP]
他就报错
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 ''' at line 6
我搞不懂了为什么呀。
如果我把[PHP]TERMINATED BY '\r\n'[/PHP]该成[PHP]TERMINATED BY '\r\n[/PHP]这样到是不报错了。但是出来的文件。行之间的没有回车。
是关于转译的问题。请教下。 |
|