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.
[MindlessAnt.co.uk] [MSDN] [Paging Records With MS SQL] [Virtual CD-ROM Drive From Images] [WorldOverRide.co.uk] [Create PDF's using pure PHP] [PHP.net Search Bars] [PHP: Check Password Strength][PHP: BB Code] [PHP: Date Select] If you Question has been answered please mark the thread as [RESOLVED] Mediocre post? Please Rate it.
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;
SELECT * INTO OUTFILE 'c:\path\to\csv.csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r\n' FROM table_name;
PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2 | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am. Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!! Spread happiness and joy. Rate good posts.
lintz - better still - use PHP5's fputcsv
Trying out VB .NET 2005 Express
Forum Rules