Sandbox test problem on pp_confirm.php page
I have a payment cart which I am testing locally using PayPal sandbox and have problem when the payment process reaches the pp_confirm.php page. In my case - pp_confirm-d.php as I have another cart on the same site using the standard file name.
Basically when the process reaches the page I get the error message "Your SQL statement failed to execute."
Once payment completes it should re-direct to a page called - checkout_success-d.php.
I have tested it remotely and it works fine so theres something about my testing environment that it doesn't like.
I've attached all relevant pages but you might need more..
Thanks in advance