This is a tad late and perhaps superfluous, but why are you bothering with all this dynamic sql and so on? When you execute an update in mysql it only changes the columns you specify, yes? So just leave all the other fields blank and let the database handle it. Eg, assuming you have a hash with the key being the column name and the value being the, uh, value, then just do something like:
my $sql='UPDATE table SET '.join',',map {"$_=".quote($hash{$_})} keys
+%hash;
Then, in your example, you just end up with sql looking like:
UPDATE table SET phone='456'
Obviously you need a where statement and so on, but thats simple. This way you only touch the fields you want to change and you don't need to worry about restoring the old values and fun stuff like that. The only problem I see is if they wanted to submit say, an empty field and not update the value which would probably require something slightly more complicated then a nice map, but perhaps you could chain maps:
map {"$_=".quote($hash{$_})} grep defined $hash{$_},keys %hash;