RE: [PHP] export data to text file
Hi If what you mean is... you want to be able to write to a file on the browsers computer, then please let us know if you find a way. To my knowledge, there is not any intended way to do this... you wouldn't want any old website to be able to manipulate your hard drive would you? It might be possible if you write an applet, otherwise, pretty much the only thing you should be able to write to the hard drive is a cookie. HTH Todd. -Original Message- From: Diana Castillo [mailto:[EMAIL PROTECTED]] Sent: Sunday, 29 September 2002 12:03 AM To: [EMAIL PROTECTED] Subject: [PHP] export data to text file 8--- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] export data to text file
okay, how can I write a file in csv format either to the browser or to the server? If I use the Mysqladmin page I get all the fields, I just want some of them. Diana -- See my web page: http://www.netrox.net/%7Ecastillo/ Todd Pasley [EMAIL PROTECTED] escribió en el mensaje [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi If what you mean is... you want to be able to write to a file on the browsers computer, then please let us know if you find a way. To my knowledge, there is not any intended way to do this... you wouldn't want any old website to be able to manipulate your hard drive would you? It might be possible if you write an applet, otherwise, pretty much the only thing you should be able to write to the hard drive is a cookie. HTH Todd. -Original Message- From: Diana Castillo [mailto:[EMAIL PROTECTED]] Sent: Sunday, 29 September 2002 12:03 AM To: [EMAIL PROTECTED] Subject: [PHP] export data to text file 8--- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] export data to text file
okay, how can I write a file in csv format either to the browser or to the server? If I use the Mysqladmin page I get all the fields, I just want some of them. Diana You can use the SELECT ... INTO OUTFILE query like someone else mentioned, and then use passthru() to send the file to the browser. It'll come out as text to the user and appear in the browser. If you want it available to download, then you'll have to send attachment headers before passthru(). If you don't have FILE privs so you can use the above query, then you could do something like this: $result = mysql_query(SELECT ... FROM table WHERE ... ); while($row = mysql_fetch_row($result)) { echo implode(,,$row); } You can use \t instead of , or whatever. That doesn't put quotes around strings or anything like that, though... ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] export data to text file
Why not write to a file on the server and generate a link to it? Collect info write file user downloads file Curtis Diana Castillo wrote: okay, how can I write a file in csv format either to the browser or to the server? If I use the Mysqladmin page I get all the fields, I just want some of them. Diana -- See my web page: http://www.netrox.net/%7Ecastillo/ Todd Pasley [EMAIL PROTECTED] escribió en el mensaje [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi If what you mean is... you want to be able to write to a file on the browsers computer, then please let us know if you find a way. To my knowledge, there is not any intended way to do this... you wouldn't want any old website to be able to manipulate your hard drive would you? It might be possible if you write an applet, otherwise, pretty much the only thing you should be able to write to the hard drive is a cookie. HTH Todd. -Original Message- From: Diana Castillo [mailto:[EMAIL PROTECTED]] Sent: Sunday, 29 September 2002 12:03 AM To: [EMAIL PROTECTED] Subject: [PHP] export data to text file 8---