> okay, how can I write a file in csv format either to the browser or to
> 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

Reply via email to