Big file?
Here is the PHP code
For every line in there, it's suppose to add it into the database. It works for small files, however, the file I am working with is around 2gb
So I updated the memory allocation in php.ini yet, when I run this I get a blank page… any suggestions?
Thank in advance,
a new user
3 Replies
As an aside, I think one of the biggest problems with PHP is that it encourages quoting rather than binding variables when passing commands to SQL. One mistake and you've got an injection attack.
Well, I set it up so it wouldn't time out, and it doesn't even load. Just generates a blank page, with no queries being executed. Ideas?
By the way, when I try this on another server, it inserts the queries… but, it stops at 50000, for quota reasons.
@1st:
Hi there, I quite recently bought a linode, and was wondering how to get this script working…
Here is the PHP code
It works for small files, however, the file I am working with is around 2gb
file reads an entire file into an array.. so you are trying to read a 2gb file into memory. Try fgets and insert one line at a time.
kenny