";
$add_ecn=$_SESSION['add_ecn']['ecn_data'];
echo "Filtering for query...
";
$insert = array();
foreach($add_ecn as $key => $value)
{
//keys which we dont want to add
if($key == 'planning'
AND $key == 'nextstep')
continue;
$insert[] = $key.' = "'.$value.'"';
}
// $add_code = "INSERT INTO `callreg_tbl` ( `pcode` , `instock` , `nilstock` , `Reasoncode` , `date` , `userid` , `whs` ) VALUES ( '$pcode', '$instock', '$nilstock', '$reasoncode', '$date', '$userid', '$whs' )";
echo "Inserting ECN data to mysql...
";
mysql_query("INSERT INTO `Ecn_Notes` SET ".implode(',',$insert));
echo mysql_errno() . ": " . mysql_error(). "\n";
echo "
";
print_r($insert);
$add_code = "FLUSH PRIVILEGES";
mysql_query($add_code) or die('Error, insert query failed');
// print('
Date raised: '.$add_ecn['Date_raised'].'
');
// print('Implementation date: '.$add_ecn['Imp_Date'].'
');
// print('Units affected: '.$add_ecn['Units_affected'].'
');
// print('Reason for change: '.$add_ecn['Reason_Chng'].'
');
// print('Assembly updated: '.$add_ecn['Assem_Details'].' ');
// print('New assembly: '.$add_ecn['assem_new'].'
');
// print('Drawing details: '.$add_ecn['Draw_detail'].'
');
echo "Closing connection...
";
include 'inc/closedb.php';
exit;
?>