After looking at your sample url closer, you don't have what you think you have.
You don't need urlencode()
?cmd=update&data1=$data1&data2=$data2 //three "get" variables are being passed in the url.
means;
PHP Code:
$data1 = "apples";
$data2 = "oranges";
$var1 = $_GET['cmd']; // = update
$var2 = $_GET['data1']; // = apples
$var3 = $_GET['data2']; // = oranges
// the url has three variables not one, and the it would be better to express it this way
$data1 = "apples";
$data2 = "oranges";
$url = $_SERVER['PHP_SELF']."?cmd=update&data1=".$data1."&data2=".$data2;
echo "<a href=".$url.">update</a>"; // http://www.somewebsite.com/index.php?cmd=update&data1=apples&data2=oranges
However if the variables $data1 had more than simple "apples" or "oranges" for content. Such as "apples and oranges" then you would need to handle that situation with urlencode() which would replace the spaces with + signs. & is an expected variable separator and should not be used in any other context. I suppose %38 would work there. You could use str_replace() for that.
Bookmarks