Thread: fputcsv slow
View Single Post
Old 01-15-2013, 01:58 PM   PM User | #3
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,635
Thanks: 4
Thanked 2,448 Times in 2,417 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
Exporting is IMO the best solution as well. No point in reinventing the wheel on this.
You have other serious problems if this is taking you like 1 - 2 days. This code's job is to write a single line into the CSV file, and what will be the last record of the query. Even if you have only 1 byte of memory left, I can't see 15K records taking 2 days to iterate through. If you only want the last record appended, than simply query with a LIMIT 1 and order in reverse.
Or, you could post the code you actually have in use.
Fou-Lu is offline   Reply With Quote