COUNT(*)最大函数嵌套级别

When using count (*) php is returning the limit error reached. I have already changed my php.ini and set the value to 1000, but still continues to return error.

Count function

$this->db->query("SELECT COUNT(*) as total FROM ". db_table_prefix ."users");

DATABASE FUNCTION

public function query($sql, $args = [])
{
        if (!$args)
            return $this->query($sql);

        $stmt = $this->pdo->prepare($sql);
        $stmt->execute($args);

        return $stmt;
}

Once try this transaction method. Hope it helps

public function query($sql, $args = [])
{
    try{

       //We start our transaction.
       $pdo->beginTransaction();

        if (!$args)
            return $this->query($sql);

        $stmt = $this->pdo->prepare($sql);
        $stmt->execute($args);
       $pdo->commit();
     }
     catch(Exception $e){    
       $pdo->rollBack();
     }




        return $stmt;
}