mysql table to .csv
Posted: Thu Dec 16, 2010 5:54 am
Hi,
I have a situation where i need to convert the table fields to .csv txt file every time user clicks button on web page to get the latest list.
What would be the best way to achieve this ?
I tried this query -
but not sure about the outfile path as i get error to provide password...
Thanks
I have a situation where i need to convert the table fields to .csv txt file every time user clicks button on web page to get the latest list.
What would be the best way to achieve this ?
I tried this query -
Code: Select all
SELECT *
FROM TABLE1
INTO OUTFILE 'path\file.csv'
FIELDS TERMINATED BY '\,'
OPTIONALLY ENCLOSED BY '\"'
LINES TERMINATED BY '\n'
Thanks