How can I solve this problem with my allocated memory?

I'm exporting a table from a MySQL database. The code is good, but the table is 250,000 rows and my pipes are apparently getting clogged based on this error:

Allowed memory size of 36700160 bytes exhausted (tried to allocate 24 bytes) in C:\wamp\www\json\csv_test.php on line 19

I put this at the top of my page:

ini_set("memory_limit","35M");

But to no avail. I'm missing something....

What do you think?
brucegustPHP DeveloperAsked:
Who is Participating?
 
GaryConnect With a Mentor Commented:
Do you not have more memory than that?
Why not do batches of 50,000 and see if it goes through.
0
 
Ray PaseurCommented:
What does the code say?  Please show us all of it, not just line 19.
0
 
Ray PaseurConnect With a Mentor Commented:
You might also want to learn about phpinfo() so you can see what the true memory limit is before you set it to something arbitrary.  You can learn a lot from phpinfo()
http://php.net/manual/en/function.phpinfo.php
0
 
brucegustPHP DeveloperAuthor Commented:
Thank you, gentlemen! I figured it out and yes, Ray, I saw that too. Thanks!

BTW: Still not out of the woods. I'm a pig on roller skates, boys...

http://www.experts-exchange.com/Programming/Languages/Scripting/PHP/Q_28525834.html
0
All Courses

From novice to tech pro — start learning today.