Page 1 of 1

PHP Script to Save Selected Records from DB to CSV & Zipped

Posted: Wed Jan 11, 2017 2:43 pm
by diseman
Hi All,

I'm looking to find/purchase a script that will:

1. Backup a selected recordset from entire db to .csv file. Will always have a "WHERE id = ";" so file(s) will be rather small.
2. If must be more than one file (i.e. One file for each table) then I would like it to create a folder, save all the files to it, .zip the file, download the file, delete everything in the folder, and then delete the folder.
3. Headers (column names) are required.

I have a script that will backup one table and save it to .csv, but my requirement is for about 8 tables, so don't want to download 8 files to my desktop each time.

If anyone could point me to a script that does this, give me a script, or sell me a script, I would be grateful.

Michael

Re: PHP Script to Save Selected Records from DB to CSV & Zip

Posted: Fri Jan 13, 2017 2:53 pm
by Celauran
Doesn't seem terribly difficult to write. Check out the Zip library.