Basically, I have a table of products and I print them to a table of arrayed form fields. This is so I can tab through and make updates to all my product data and submit it all at once. When I submit, I iterate through the arrays and run update statements on every row. It's started to get bogged down now that I have hundreds of products. I would like to be able to change one value of one product, click "bulk update", and it only update the one record, instead of updating the other 100 records with the same data that was already in the database.
One idea I have is to dump the original values into a set of arrayed hidden input fields, and run a check against it, but it just feels like it would be cluttered.
Code: Select all
if ($oldfield1hiddenarray[$i] != $newfield1txtarray[$i] OR $oldfield2hiddenarray[$i] != $newfield2txtarray[$i] ETC....) {
$Query = "Update BLAH BLAH"; //Update this products data because something was modified
}Open to any suggestions.