You are here: Output as csv « PHP Programming Language « IT news, forums, messages
Output as csv

Posted by Geoff Berrow on 03/12/06 13:42

I'm trying to output the results of a database query as a csv file

The DB output is in $csv

foreach($csv as $array){
$line[]=implode($delimited_by,$array)."\n";
}
header("Content-Type: text/plain");
header("Content-Disposition: inline");

foreach($line as $output){
print $output;


On clicking the link to this file the results are output to the screen.
I can right click and save the output but I'm prompted to save it as a
..php file. How can I make it output as the right kind ( .csv) of file?

--
Regards,

Geoff Berrow

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация