refactored mysql to PDO