Is it possible to export the results of a query to a CSV file?
If so, does anyone have an example?
Printable View
Is it possible to export the results of a query to a CSV file?
If so, does anyone have an example?
You have to do it yourself, so just loop though each value and each record and write them to a file with the delimator ',' or ';' splitting them up.
Thanks John, I thought that would be the solution.
In mysql you can do it with a query:
Code:SELECT * INTO OUTFILE 'c:\path\to\csv.csv'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\r\n'
FROM table_name;
lintz - better still - use PHP5's fputcsv