Verify activation issu

the material I see is here
https://www.cnblogs.com/gaoga.

where there is doubt

if($row){ 
    if($nowtime>$row["token_exptime"]){ //24hour 
        $msg = "."; 
    }else{ 
        mysql_query("update t_user set status=1 where id=".$row["id"]); 
        if(mysql_affected_rows($link)!=1) die(0); 
        $msg = ""; 
    } 
}else{ 
    $msg = "error.";     
} 
echo $msg; 

if (mysql_affected_rows ($link)! = 1) die (0);
if there is username, in the database, the previous register.php will query the database and reply
echo "user name already exists, please change to another user name";
mysql_affected_rows ($link) can only be equal to 1 ha

this sentence will not be executed at all. Does it make sense to write it here?

its inherent logic is problematic. When mysql_affected_rows ($link)! = 1, then die (0)
can the database have been updated with, die (0) and report a successful activation?

Jul.30,2021

one is register.php
and the other is active.php
with different functions

as for the second question
read more documents

Menu