Long script strange behaviour

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I am trying to export/import about 50.000 records in a csv file which a
user can upload or downlaod from the browser.
The problem is once I hit export Firefox comes with a dowload
myscript.php window and IE just page cannot be found.
It doesn't happen with less records.
I tryied to google the problem but it doesn't seem to get me anywhere.
Also I have memory problem because I create huge associative arrays
that keep all those data temporary.
I suppose that PHP is not the right language to do this kind of data
manipulation or that I am missing something. I've seen though other
sites doing that kind of imports and exports.

Has anyone ever met that before? Firefox download window / IE page
cannot be found when you run a script ?

Thanks.. .I'll appreciate any suggestions.

Re: Long script strange behaviour

Quoted text here. Click to load it

You can use something like "LOAD DATA INFILE" statement (in case if you
use the MySQL database) that is a fastest way of importing such big
amounts of data. Although, I think this issue is not related to
database usage... You may try to trace the HTTP requests between client
and server and check what happens.

http://www.alexatnet.com/ - PHP/Zend Framework and Ajax blog

Re: Long script strange behaviour

Thanks for the reply. I allready use LOAD DATA INFILE to import... and
I do that fine.
The problem I found by looking my running processes using the command
"top" is that MySQL was busy for 3hours running select statements
because in my foreach loop of 40.000 records array I had only IDs and I
needed to get foreach ID the full details from another table.
So the solution I found is to make one big select and then have all the
Data I want stored in an array.

The problem is that I still get that Open/Save Dialog box on firefox
and I had that a few other times in other scripts as well.
Maybe is the server configuration, but then again I had that in both a
RAQ and a BSD box.

I still need someone with previous experience on what I am getting in
order to find an answer.
Both my import and export scripts work fine with 1000 records. The
problem starts when I increase the size of data.

Thanks again.

Site Timeline