I think should be better you create one function for make it more simple like below :
function getData($field,$table,$cField,$cVar){
$result = mysql_query("SELECT ".$field." FROM ".$table." WHERE ".$cField." = ".$cVar."");
$row = mysql_fetch_row($result);
return $row[0];
}
So You can call that function,If you want to retrieve a single field from one row like below:
echo getData("nama","users","userID",$_GET['userID']);