I am reading the lines from a CSV file and storing in a PHP array. I created a function to save the array content into a MySQL table. However, it only saves around 210 rows while the array has more than 100K positions... I checked the array size and it shows much more than what is being saved into the database. Is there any limit per operation that MySQL accepts?
Also, MySQL doesn't show any error. It only loads those few records and that's it.
My function:
function save_uar($data)
{
if (isset($data))
{
foreach($data as $row)
{
$id = $row['_id'];
$period = $row['period'];
$reviewStatus = $row['reviewStatus'];
$dataSource = $row['dataSource'];
$dataId = $row['dataId'];
$offset = $row['offset'];
$employeeId = $row['employeeId'];
$firstName = $row['firstName'];
$lastName = $row['lastName'];
$resourceName = $row['resourceName'];
$resourceType = $row['resourceType'];
$resourceUserId = $row['resourceUserId'];
$role = $row['role'];
$reference = $row['reference'];
$resourceGroup = $row['resourceGroup'];
$businessUnit = $row['businessUnit'];
$lifeCycle = $row['lifeCycle'];
$userComment = $row['userComment'];
$extractDate = $row['extractDate'];
$reason = $row['reason'];
$reviewDate = $row['reviewDate'];
$reviewerId = $row['reviewerId']
$sql = "INSERT INTO uar VALUES (
'".$id."', '
".$period."', '
".$reviewStatus."', '
".$dataSource."', '
".$dataId."',
".$offset.",
".$employeeId.", '
".$firstName."', '
".$lastName."', '
".$resourceName."', '
".$resourceType."', '
".$resourceUserId."', '
".$role."', '
".$reference."', '
".$resourceGroup."', '
".$businessUnit."', '
".$lifeCycle."', '
".$userComment."', '
".$extractDate."', '
".$reason."', '
".$reviewDate."', '
".$reviewerId."'
); ";
$result = $this->db->query($sql);
}
}
}