作者:小马哥 | 来源:互联网 | 2023-05-18 00:24
Imhavingproblemusingxampp(4.1.6)phpmyadminexportfunction.WhenIexport,Iselectcsvfore
I'm having problem using xampp (4.1.6) phpmyadmin export function. When I export, I select csv for excel format, but it will return the data like:
我在使用xampp (4.1.6) phpmyadmin导出功能时遇到了问题。当我导出时,我选择了excel格式的csv,但是它会返回如下数据:
1;"data1";"0";"6828";"2014-03-13 13:54:26";"2014-03-13 13:54:26";"file";;"2014-03-14 14:45:51"
So I tried the syntax:
所以我尝试了语法:
SELECT * FROM `directory_listing`
INTO OUTFILE 'C:/test.csv'
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n'
Now the format is the same as the table view as in mysql table. Problem is, I want to display the column name on 1st row. How can i do that?
现在的格式与mysql表中的表视图相同。问题是,我想在第一行显示列名。我怎么做呢?
By the way, below is the interface of my phpmyadmin export function.
顺便说一下,下面是我的phpmyadmin导出函数的接口。
I tried to export it as normal csv, but it still return the same. even worse, ALL the data is put inside 1st row.
我尝试将它导出为普通的csv,但它仍然返回相同的值。更糟糕的是,所有的数据都放在第一排。
2 个解决方案