-
This is a PHP script to create csv files from MySQL tables and zip them into a single archive. It needs to be done now, so please do not bid unless you can do it now.
WITH STRUCTURAL VARIABLES SET LIKE THIS (you can modify this format):
$archive_file = "[login to view URL]";
// Table 1
$file_name[] = "[login to view URL]";
$table[] = "people";
$fields[] = "id, rec, namef";
$field_labels[] = "id, record, name";
$sort_field[] = "name";
$sort_order[] = "asc";
// Table 2
$file_name[] = "[login to view URL]";
$table[] = "survey";
$fields[] = "id, person, date";
$field_labels[] = "id, linked person, date";
$sort_field[] = "date";
$sort_order[] = "desc";
// Additional tables (unlimited)
THE SCRIPT SHOULD DO THIS:
1) For each table specified (each , create a csv file named $file_name[] with these parameters:
- all rows in the table
- only the fields listed in $fields[]
- rows sorted by $sort_field[] in $sort_order[] order
- header record using values in $field_labels[]
- all field values stripped of " character, replaced with - character
- all field values enclosed by ""
2) Zip the csv files into an archive named $archive_file
3) Remove any temporary files, so the only file left is the archive file
-