'How can i count affected rows in SQLite3 with PDO PHP?

Hi i am trying to check if the IP is in the blocked list or not. I am using SQLite3 in PHP. my problem is when trying to check with the function bellow it returns always true.

    function isBlocked($ip){
        global $pdo;
        $check = $pdo->prepare("SELECT * FROM blockedUsers WHERE ip='".$ip."'");
        $check->execute();
        if($check->rowCount() >= 1){
            return true;
        }else{
            return false;
        }
    }


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source