|
|
 |
RE: FN-FORUM: sql / csv query
date posted 24th November 2006 12:17
Pam, you could just modify the query I'm using to INNER JOIN another table
for example ..
Still no idea how you get the column headers in the csv file though ;)
HTH
Mark
-----Original Message-----
From: [EMAIL REMOVED] [EMAIL REMOVED] On Behalf Of Mark Bell
Sent: 22 November 2006 10:24
To: FN-FORUM / [EMAIL REMOVED]
Subject: FN-FORUM: sql / csv query
Morning all,
I'm using a query similar to this:
mysql_query("SELECT * INTO OUTFILE '/tmp/products_$date.csv' FIELDS
TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"' LINES TERMINATED BY '\n' FROM
products")
To grab a product list and drop it into a csv, which is then emailed to the
site admin.
However, this only grabs the data, omitting the column headers - I don't
need it to look pretty, but would like the column headers in place.
Any ideas how to get them in the csv as well - or maybe a different
approach?
TIA
Mark
---
Mark Bell
http://m4rk.biz
tel: 08701 996969
mob: 07740 861862
--
Freelancers, contractors earn more with Prosperity4
Call 0870 870 4414 or visit www.prosperity4.com
and benefit from Inland Revenue approved expenses today.
To advertise here: http://www.freelancers.net/advertising.html
|
 |
|