Re: export to csv file

From: Date: Sat, 28 Sep 2002 16:03:08 +0000
Subject: Re: export to csv file
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-22070@lists.php.net to get a copy of this message
On Sat, 2002-09-28 at 10:02, Diana Castillo wrote: > Hi, I want to export some fields on a regular basis from a table to a text > file, preferable to the users local computer. I tried writing to a file with > fopen but I get "permission denied" when I try to open it for writing. > What is the best solution? > Thanks, > Diana If you want to do it as a csv file the best way is select <fields> into outfile '<outfile path>' fields terminated by ',' from <table> <conditions>. this writes to a csv file. now being able to do things wtih that file depends if you are using a Unix clone you have to watch the permissions on the file it sounds like that is the problem . perhaps add yourself to the mysql group if the file has group permissions. the last is just a thought. John Coder

« previous php.db (#22070) next »