this might help:
When you put the variable, $tmp, within single quotes, it is treated literally as a string comprising of: a dollar sign and the letters t-m-p.
So, if you want to use that variable as an array key, do not put it in quotes, and just use: $_POST[$tmp]
Conceptually, to do what you want in another way, you can do your selection of current values from the DB first, when you render the form, and place the current values in HIDDEN form fields.
Then, upon form submission, you can compare the original value in the HIDDEN field against the new value entered by the user. if they are different, you then run your UPDATE routine...
HTH....