How can i write fetched data from mysql database to csv file

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
B.Murali Krishna
Forum Commoner
Posts: 28
Joined: Fri May 12, 2006 2:05 am
Location: Hyderabad,India
Contact:

How can i write fetched data from mysql database to csv file

Post by B.Murali Krishna »

hello,
how can if write the data which i queiried from database, to csv file and i need to down load that file,
if used fputcsv($fp, split(',', $line));
but this function not supported in some vesions i think

this was my applications, please help me regaring this topic.

Regards,
Murali
Last edited by B.Murali Krishna on Mon Jul 17, 2006 5:18 am, edited 2 times in total.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

Usually you send the proper headers and then start fetching rows, implode each row with the field delimiter, and echo with the line delimiter appended.
(#10850)
Post Reply