Did you forget to enclose the $id with single quotes:
$result = mysql_query("SELECT * FROM users where UserID='$id'");
However, mysql_query has been deprecated, should use mysqli, and use prepared-statements-in-php-and-mysqli/
] to prevent sql injection.
Do you understand your code? Did you get it from somewhere?
The exit($id); will stop the script and print out the value of $id, it is a way to check if the $id contains any value, apparently it did not, that was the reason why the update sql did not update because the WHERE condition was not met. Where is the source of this $id? it was from adminedit.php, that was the reason I suggest the original solution in solution 1.