I am working on the Drupal CMS, where i am parsing a file & storing the data in DB.
So if there are more than 440 records (rows) in the file, it does not save it further. It works for the rows less than 440. It is an strange issue.
$query = db_insert('table_name')->fields(array('field1', 'field2', 'field3'));
$row = 1;
while (($data = fgetcsv($handle, 0, ",")) !== FALSE)
{
$num = count($data);
if ($row > 1) {
$query->values(
array(
'fields1' => $data[0],
'fields2' => $data[2],
'fields3' => $data[4]
));
if($row == '440'){
break;
}
}
$row++;
}
$query->execute();
/////
if($row == ‘440’){
break;
}
Is added to check how many rows it saves.. If i increase the 440 to 460, it doesn’t save records to DB.
Remove this block and it’ll be just fine.