how to save a csv file in server itself containing the data fetching form mysql dtatbase? i want to download a database in csv format.I am able to download the contants directly, but I need to save all the fetched data into server itself and provide the user a link to download the data into xls or csv format. I am new to this field and I really don't have any idea how to save the CSV file in server itself.
Asked
Active
Viewed 578 times
0
-
Can't you simply write your CSV content in a new file ? – Clément Malet Jun 27 '14 at 11:21
3 Answers
1
You can first query the database with required conditions and write the contents into a CSV file on your application server & later on provide a link to this file in your application. You may check the following link on how to obtain data, convert to CSV & write to file :
0
- Create file using CSV separator i.e
;
- Create downloading page, you have to set some headers
- Download All.

turson
- 421
- 2
- 9
0
You can write fetched data in a file and then can save this file your server.
There are many php libraries for this job. I Personally use PHPExcel. You can download it from: https://phpexcel.codeplex.com/

Umair Hamid
- 3,509
- 3
- 23
- 25