... my %info = (); my $hashref = (); my $dbh = connectstuffhere->connect_mysql(); # this its all set, connection works, not the issue here my $sth = $dbh->prepare("select * from mytable where lastn = ? and username = ? ") or &die("Can't select: ",$dbh->errmsg); $sth->execute($lname,$username); $hashref = $sth->fetchrow_hashref; %info = {$hashref}; if (!(scalar %info)) { # what does this mean? &dead("Username '$username' is not here."); } if ($info{username} eq "") { # but there is a username value in the database and the field its called username &dead("No username found!"); } ...