I am working on a project that requires me to forecast material usage for a period and generate a summary.I am able to generate the forecast,which can be as long as 1200rows.However,in order to generate the summary,the record need to be store on the database where they can be fetched to summarized.The issue is that: when a button is clicked to generated the summary,the code only works, when the total rows<=200.I have checked the code,search StackOverflows and even change the max_allowed_packed=999MB.Yet it is still not inserting into the Database.See code below and kindly assist as i have searched without getting solution.
See the Insertion code:
if(isset($_POST['exportBtn']) && isset($_POST['sflt'])){
//$arr = array();
foreach($_POST['sflt'] as $key => $value) {
set_time_limit(0);
$eflt = mysql_prep($_POST['sflt'][$key]);
$emodel = mysql_prep($_POST['smodel'][$key]);
$eengine = mysql_prep($_POST['sengine'][$key]);
$eloc = mysql_prep($_POST['sloc'][$key]);
$estye = mysql_prep($_POST['sstye'][$key]);
$ensvr = mysql_prep($_POST['snsvr'][$key]);
$eehd = mysql_prep($_POST['sehd'][$key]);
$epname = mysql_prep($_POST['spname'][$key]);
$inExp = mysqli_query($con,"INSERT INTO tab_forecast(fltno,model,engine,loc,serviceType,nextSvr,usageHr,partName)VALUES ('$eflt','$emodel','$eengine','$eloc','$estye','$ensvr','$eehd','$epname')");
}//End for-each loop
Please, note that i have also tried to create a single insert statement instead of insertion one by one,yet the result is still the same - not inserting all records into the database. My database engine is set to InnoDB,yet the same result. Please, what else can i do or is there a better way to solve this issue. Note, i have search SO,but no solution meets my need, hence this question.