Re: CSV Files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Oh, I am not putting quotes around each field that i get from MySQL. There are no quotes in the data so that is good.

Sorry I put "/n" and I meant to put chr(10).

-Jason

On Oct 22, 2008, at 6:58 PM, Stut wrote:

On 23 Oct 2008, at 02:41, Jason Todd Slack-Moehrle wrote:
Actually i am ending the row headers with a chr(10); // LINE FEED

From the code you included in your original post...

echo "/n";


There was no mention of chr(10).

Outputting data in CSV format is not hard. Simply echo the header row if necessary, followed by "\n". Then output each line taking care to put string values in quotes which means you also need to escape quotes in the data. After each line echo "\n". That's really all there is to it.

If you're still having problems I suggest you post the exact code you're using, anything else just makes it harder for us to provide effective help.

-Stut

--
http://stut.net/

On Oct 22, 2008, at 5:12 PM, Stut wrote:

On 23 Oct 2008, at 00:59, Jason Todd Slack-Moehrle wrote:
After I right out the column headers do I have to put a '/n' to have it start a new line in the CSV file? I think I do.

A new line is \n not /n, and it must be in double quotes (") not single (').

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux