Depending on your version of mysql, there are a couple of tricks you can use to update multiple rows, each with a different value, in 1 query. Otherwise, the only way to avoid running a query for each row inside a loop is to use a work table.
Work Table - 3 queries
query 1
INSERT the primary key and the new data into a work table
query 2
UPDATE the main table from the work table through a join on the primary key
query 3
DELETE all the rows from the work table ready for next time
version 3.55 or higher - 1 query
REPLACE INTO table
VALUES (id=$ids[0], col1=$var1[0], ...),(id=$ids[1], col1=$var1[1],...) ....etc
This works because for can submit multiple value lists to replace multiple rows with the updated data. You will need to supply the full record, ie all columns.
version 4.1.0 or higher - 1 query
INSERT INTO table
VALUES (id=$ids[0], col1=$var1[0], ...),(id=$ids[1], col1=$var1[1],...) ....etc
ON DUPLICATE KEY UPDATE
This can be used to update the rows because the primary keys already exist.
You will still need to run a loop to extract the data from the post arrays and build the queries, but will not have to run an update query for each row. The saving will of course depend on how many rows you are processing.