veeps;10993708 wrote:The code works to update at least one of the (LIMIT) five possible results per page while allowing the possibility of deleting at least one of the others. That is/was the goal. So, the admin can delete one image and/or update another.
Right, but as it is right now your code is going to process every group of form fields and execute an UPDATE query, regardless of whether or not it also has deleted (or will delete in a future iteration) that same row in the DB.
veeps;10993708 wrote:And, I didn't think the delete checkbox requires any escaping, as nothing here is being INSERTED, only deleted
The type of query is irrelevant. It could be SELECT, INSERT, UPDATE, DELETE, or WATERMELONS_ARE_GROSS and the fact remains that user-supplied data should not be inserted anywhere into the SQL query string without first being sanitized.
veeps;10993708 wrote:(the value thereof being strictly INT)
How do you know? Who says the user-supplied data you're receiving is going to be in the same format that you assume it will be?
veeps;10993708 wrote:Is it necessary to escape even the checkbox $_POST['delete'] value?
Is it user-supplied data? If so, yes. If not, no. (Hint: the answer is yes!)
It doesn't matter if it's a checkbox, text field, button, hidden input, HTTP header, or anything else - all user-supplied data should be considered suspect until it has been properly sanitized for use in a SQL query.