OK, first you have to ask yourself a question, are you going to be editing more than one copy of the same basic form, or just on form at a time.
If I'm gonna have one form at a time, I like to have the fields named something like $input['last_name'] or $input['number']; Then have an array like: $fields = array('last_name','number'); and iterate over that to get the names.
If you'll be needing to have that same form multiple times, just use a numeric index for each occurance, so they're named like:
$input[0]['last_name'];
...
$input[4]['last_name'];
Then you just do a for next for however many are being processes, and build a query for each one.