PHP not updating mysql

################################################################################
#------------------------------------------------------------------------------#
#  Activate Function
#------------------------------------------------------------------------------#
################################################################################
function Activate(){
DBconn();
            $result = mysql_query("SELECT userid FROM users WHERE code=".$_GET["code"]);
             $row=mysql_fetch_row($result);
             $ID=$row['userid'];
             if(mysql_numrows($result) != 0){
                   $query = mysql_query("UPDATE users SET isactive='1',code='0' WHERE userid='$ID'");
                   echo 'Your account is now active, feel free to login now'.$row['userid'];
             }else{
                   echo _VALIDATE_ERROR;
             }
       
}

i’m not sure what i’m doing wrong, its supposed to check and see if theres a matching code in the database and update it if it does find a matching code

but so far does not can someone help please?