ok here goes:
I am using the following html code for my form:
<form>
<input type="text" name="batchupdate[][product_name]" value="product1">
<input type="text" name="batchupdate[][product_price]" value="4.99">
<input type="text" name="batchupdate[][upn]" value="2020">
<input type="text" name="batchupdate[][product_name]" value="product2">
<input type="text" name="batchupdate[][product_price]" value="8.99">
<input type="text" name="batchupdate[][upn]" value="2021">
<input type="text" name="batchupdate[][product_name]" value="product3">
<input type="text" name="batchupdate[][product_price]" value="12.99">
<input type="text" name="batchupdate[][upn]" value="2022">
</form>
Then the php code I am using is this:
if (isset($_POST['batchupdate']) && is_array($_POST['batchupdate'])) {
foreach($_POST['batchupdate'] as $i) {
mysql_query("UPDATE `Products` SET
`productname` = " . $i['product_name'] . ",
`productprice` = " . $i['product_price'] . "
WHERE `upn` = " . $i['upn']);
}
}
I understand I am looping through the array incorectly?
Needless to say it doesn't work, anyone got any ideas?