I fixed the issues I had returning the proper values in the DB using the returned test.txt file. I had formatting problems on both the button side and the 'Type' in the column bindings that I figured out.
However, i still cannot send the data if the INSERT is embedded within the PayPal code. I have tried your code as well. I've attached one of the many versions I tried. (I had placed the code at the bottom, after the VERIFIED $retVal and between every set of {} brackets with no luck. I thought it should go either after line 24 or on line 34 or like it is at the bottom in the attached version.)
I can still get the text.txt file to create regardless of where it is on the page.
I'm going to see what if anything I can find on stackoverflow. I haven't heard anything from PayPal help yet. I tried contacting their developers help. this morning.
Not sure if you have any more ideas?