If you attach a copy of your confirm.php and pp_confirm.php page I can advise you on the lines to update.
The error you get on checkout implies an issue connecting to your database... but rather than debug that, let's try updating the pages manually.