Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exporting excessivly large MySQL queries as .csv

Status
Not open for further replies.

admoore

IS-IT--Management
May 17, 2002
224
US
I have numerous functioning scripts which create a csv file with the results of a MySQL query and hand the result off to the browser for download (and will need to address uploading like-sized files as well).

My problem occurs when file size and execution times become excessive; for example, if I use phpMyAdmin to create the same file I am attempting with my code, the result is 122+Mb that takes some 10 minutes to create... I have tried adding various environment variable mods to an .htaccess file to no avail:

Code:
php_value upload_max_filesize 256M
php_value post_max_size 256M
php_value max_execution_time 900
php_value max_input_time 900
php_value memory_limit 512M

Errors such as this, or simple time-outs persist:
Code:
Fatal error:  Out of memory (allocated 166199296) (tried to allocate 165937300 bytes)

I have noticed several commercial apps I use seem to use javascript in order to keep sessions alive during large file creation...

Is anyone here aware of a resource I might use to resolve my problem?

TIA,

-Allen M.
 
i would suggest that you use mysqldump via exec, then pick up the file to send to the browser. that will be the fastest and most memory efficient method of doing the necessary.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top