Converted to new PDO database class