I want to download csv file containing states.All states are available in the states table
Any one can pls help me
how to picks the data from database and put into csv file
Moderator: General Moderators
Re: how to picks the data from database and put into csv file
There are 2 ways I can think of to do this.
Either you connect to the database, iterate over the table and output it to a page. Make sure you set the page content type to csv and as a download and you should be fine. Or, you could use the MySQL OUTFILE command.
Google is your friend
http://www.ineedtutorials.com/articles/ ... p-tutorial
Either you connect to the database, iterate over the table and output it to a page. Make sure you set the page content type to csv and as a download and you should be fine. Or, you could use the MySQL OUTFILE command.
Code: Select all
SELECT * INTO OUTFILE ...
Google is your friend
http://www.ineedtutorials.com/articles/ ... p-tutorial