On 20-Jul-2001 Nelson Goforth wrote:
> Thanks to Steve and Jeff for your replies.
> 
<snip>

> 
> The new system will store the data in MySQL table(s) for retrieval 
> not only of specific survey results, but (as I'm collecting industry 
> type and demographic data as well) in more complex ways as well.  I 
> may actually STILL store the individual survey results in text files 
> for simplicity and 'bullet-proofness', but I need the added 
> flexibility of being able to retrieve the data in more than one way. 
> I AM a little uncertain of how best to get the data into a text file 
> to then feed into Excel (pretty reports and graphs), which was the 
> issue in my second question.  Probably it's simply 'SELECT...INTO 
> OUTFILE...', but I'm trying to think of ways to avoid my client 
> having to ftp.
> 

 --- directly into Excel ---
print 'Content-type: application/ms-excel', "\n";
print 'Content-Disposition: inline filename="foo.csv"', "\n\n";

 -- or save as file ---
print 'Content-type: octet/stream', "\n";
print 'Content-Disposition:  attachment; filename="foo.csv"', "\n\n";


$res=SQLQuery("SELECT ...");

while ( @row = $res->fetchrow()) {
   print join(',', @row), "\r\n";
}

Regards,
-- 
Don Read                                       [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.
                            (53kr33t w0rdz: sql table query)

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to