"; $add_ecn=$_SESSION['add_ecn']['ecn_data']; print_r($add_ecn); echo "Filtering for query...
"; $insert = array(); //keys which we dont want to add foreach($add_ecn as $key => $value) { if($key == 'planning' OR $key == 'nextstep') continue; $insert[] = $key.' = "'.$value.'"'; } echo "Inserting ECN data to mysql...
"; //print_r($insert); // mysql_query("INSERT INTO `Ecn_Notes` SET ".implode(',',$insert)); // $add_code = "FLUSH PRIVILEGES"; // mysql_query($add_code) or die('Error, insert query failed'); // // $ecn_no = mysql_insert_id(); // echo "
ECN created with ID number: $ecn_no
"; echo "
Adding parts...
"; $parts=$_SESSION['part_form']; echo "
Parts array before key filter:
"; print_r($parts); $insert=array(); echo "

"; //keys which we dont want to add foreach($parts as $key => $value) { if($key == 'part_restart' OR $key == 'part_add' OR $key == 'part_finished') continue; $insert[] = $key.' = "'.$value.'"'; } echo "
Parts array after key filter:
"; print_r($insert); foreach($insert as $part_form) { // mysql_query("INSERT INTO `Ecn_Notes` SET ".implode(',',$part_form)); // $part_form = "FLUSH PRIVILEGES"; // mysql_query($part_form) or die('Error, insert query failed'); // //// print('
Part number: '.$part_form['txtSearch'].'
'); //// print('Part quanitity: '.$part_form['part_qty'].'
'); //// print('Part action: '.$part_form['part_num_action'].'
'); //// mysql_query("INSERT INTO `Parts` SET $ecn_no,".implode(',',$insert)); } echo "
Closing connection...
"; include 'inc/closedb.php'; } ?>