note 25700 added to function.fgetcsv
| From: | mccommunity at hotmail dot com | Date: | Wed, 02 Oct 2002 15:44:24 +0000 |
| Subject: | note 25700 added to function.fgetcsv | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-37553@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++;
}
--
http://www.php.net/manual/en/function.fgetcsv.php
http://master.php.net/manage/user-notes.php?action=edit+25700
http://master.php.net/manage/user-notes.php?action=delete+25700
http://master.php.net/manage/user-notes.php?action=reject+25700