PHP Classes

PHP MySQL Query Download to CSV File: Download results for a large MySQL query in CSV

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 81 All time: 10,095 This week: 45Up
Version License PHP version Categories
phpdownloadcsv 1.0MIT/X Consortium ...5Databases, Tools, Files and Folders, P...
Description 

Author

This package can download results for a large MySQL query in CSV.

It can take a given SQL query and connects to a given MySQL database server to generate a raw SQL query by replacing prepared parameters using PDO.

The package can execute the mysql command line program to execute the prepare query and output the results to a CSV file in a server directory.

It can also serve the generated CSV file for download.

Picture of Ramesh Narayan Jangid
  Performance   Level  
Name: Ramesh Narayan Jangid <contact>
Classes: 9 packages by
Country: India India
Age: 48
All time rank: 3134203 in India India
Week rank: 14 Up1 in India India Up
Innovation award
Innovation award
Nominee: 4x

Winner: 3x

Details

phpDownloadCsv

PHP Download CSV up to millions of records

To enable compression for downloading dynamically generated CSV files in NGINX if the browser supports compression, you can use the gzip_types directive in the NGINX configuration file. The gzip_types directive is used to specify which MIME types should be compressed.

Here's an example of how you can enable compression for downloading dynamically generated CSV files in NGINX:

<code>http { gzip on; gzip_types text/plain text/csv; }</code>

In this example, we have enabled gzip compression and specified that text/plain and text/csv MIME types should be compressed. You can also use the text/* wildcard to include all text-based MIME types.

This configuration will automatically compress the content of dynamically generated CSV files if the browser supports compression, which can significantly reduce the size of the files and speed up their download time.


  Files folder image Files (3)  
File Role Description
Plain text file downloadCsv.php Class Class source
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:81
This week:0
All time:10,095
This week:45Up