This one has me pretty rattled so I thank you in advance for your assistance. There seem to be a number of walkthroughs on this topic but it seems I may be skinning this cat a bit different. . . .
I have a purchase order form that I'm using javascript to dynamically add rows to a table and capture data for multiple line items. I'm then collecting data for each column in an array. For example I have "Cust_PN", "Qty", "Price" as columns and arrays for each. . . Cust_PN[0] Cust_PN[1] and Cust_PN[2] for line items 1-3 respectively. I then have Qty[0], Qty[1], and Qty[2] and so on.
I can get this to echo properly without issue. However, when I go to post I am only posting the array data from the last entry *[3] per my example above.
I currently have the following code/query. . . again any help would be much appreciated.
$query1 = "INSERT INTO SO_Items (Timestamp,SO_Num,SO_Rev,SO_Line_Item,Cust_PN,Cust_PN_Rev,My_PN,My_PN_Rev,Description,
Qty,Sale_Price,UOM,Program,Required_Date)
SELECT NOW(),'$SO_Num','$SO_Rev','$SO_Line_Item[$a]','$Cust_PN[$a]','$Cust_PN_Rev[$a]','$My_PN[$a]','$My_PN_Rev[$a]','$Description[$a]','$Qty[$a]','$Sale_Price[$a]','$UOM[$a]','$Program[$a]','$Required_Date[$a]'" or die ('Error posting data');
foreach($Cust_PN as $a => $b) {
mysql_query($query1);
}
I'm quite certain there are a number of issues in the above. . . thank you in advance.