View Single Post
Old 01-10-2011, 03:57 AM  
Angry Jew Cat - Banned for Life
(felis madjewicus)
 
Industry Role:
Join Date: Jul 2006
Location: In Mom & Dad's Basement
Posts: 20,368
Quote:
Originally Posted by Kiopa_Matt View Post
Yep, but it's best to do it line-by-line, instead loading the entire file into memory at once. Create mySQL table,then for example:

Code:
$file = fopen('myfile.txt', 'r');
while ($line = fgets($file)) { 
     // Parse data, and insert into mySQL table
}
fclose($file);
That way you're only loading one line into memory each time, instead of the entire 20MB of data.
Thnx I'll follow up on this a little more and hopefully get a good solution worked out.
Angry Jew Cat - Banned for Life is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote