note 25700 rejected from function.fgetcsv by betz

From: Date: Thu, 03 Oct 2002 09:18:56 +0000
Subject: note 25700 rejected from function.fgetcsv by betz
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-37608@lists.php.net to get a copy of this message
I am having a problem loading large csv files and I am not sure what to do. Is there a size limitation in php with csv loading? Here is the code: $row = 1; while ($data = fgetcsv ($fp,9000000,",")){ $query="INSERT INTO data1 VALUES ($event"; $num_fields = count($data); for ($x=0;$x < $num_fields;$x++){ $query .= ", '$data[$x]'"; } $query .= ")"; $r = pg_exec($c,$query); if ($r){ // echo "row $row loaded ok <br />"; } else { $errors[] = "There was a problem uploading row $row"; } $row++; }

« previous php.notes (#37608) next »