The issue is here:
$userRow=$stmt->fetch(PDO::FETCH_ASSOC);
if($userRow == '0'){
You're getting an associative array back from fetch
, and comparing it with 0
on the next line. Instead, you want to check the value for the column you've selected in your query, and compare with that:
$userRow=$stmt->fetch(PDO::FETCH_ASSOC);
if($userRow['activedd'] == '0'){