Reengineered with PDO prepared statements.