rsagona1 Posted March 23, 2009 Share Posted March 23, 2009 Hello, the best way to describe this is with a picture. As you can see, I already know how to loop through the Product[] array and check if it is checked, and if so, insert it into the mySQL database. But how can I tie the quantity to each checkbox? The quantity would be a textbox. I could name each textbox the product ID (like 1,2,3..etc). But I don't see how that would help. Can anyone please help me? Thanks! Link to comment https://forums.phpfreaks.com/topic/150776-dealing-with-post-data-arrays/ Share on other sites More sharing options...
rsagona1 Posted March 23, 2009 Author Share Posted March 23, 2009 Actually, I think I may have solved it. Since the textbox name would be unique (the product number) I could do this: while (list ($key,$val) = @each ($products)) { //$val would be product code, like Month_Fee //therefore quantity could be:txtboxQuantity{$val} $quantity = $_POST['txtboxQuantity$val]; } Link to comment https://forums.phpfreaks.com/topic/150776-dealing-with-post-data-arrays/#findComment-792165 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.