Help with functions / PDO statements

This solution is a bit different than the original posted by the OP. In the original code he is trying to use $PDO inside a function but not passing it into the function. @droopsnoot already addressed that above. Then you addressed the PDO issue of not using parameters. So I was just giving another solution that worked for me in the past. Defining $this->dbh in the constructor also allows you to call it inside all of the methods without passing it as a parameter because of the $this operator.