The problem is the conversion of t and f to
t
f
Select boolean field from postgre as ::int and in php cast to bool.
"SELECT a_moderator::int FROM users WHERE email = $1;"
$isModerator = (bool)$row['a_moderator'];