Re: How can i export database table values into .csv file?
| From: | Nick Talbott | Date: | Mon, 04 Sep 2000 11:20:08 +0000 |
| Subject: | Re: How can i export database table values into .csv file? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-15096@lists.php.net to get a copy of this message | ||
Creating a csv file is quite straightforwards using normal file handling
commands fopen(), fputs() and fclose().
In a csv file, character strings that contain commas must be enclosed in
double quotes, so the three values:
1.0
two
item, including comma
should be written as the line
1.0, two, "item, including comma"
The only thing to watch for when creating a csv file is that if you have a
character string that includes the double quote (") then you need to replace
each instance with two double quotes ("") instead of one. You can use
str_replace() to sort this.
HTH
Nick Talbott
IT Policy and Strategy Manager, Powys County Council, UK
email nickt@powys.gov.uk
FAX +44 (0) 1597 824781
web http://www.powys.gov.uk and http://www.powysweb.co.uk
-----Original Message-----
From: Bobby Thomas C <bobby@questech.net>
To: php-general@lists.php.net <php-general@lists.php.net>
Date: 04 September 2000 11:31
Subject: [PHP] How can i export database table values into .csv file?
>How can i export database table values into .csv file?
>
>I am using Oracle 8 and PHP3. I have to export the row values in an Oracle
>table to .csv file. How can i do that?
>I know that fgetcsv() function is used to get the row by row value from
.csv
>file. But how can i export from a database to a .csv file?
>
>Expecting an early reply
>
>Bobby Thomas C
>
>Questech India Pvt. Ltd.,
>e-mail: bobby@questech.net, Bangalore, India
>
>
>
>