[eluser]TheFuzzy0ne[/eluser]
Hooray! I need a vacation... xD
Apologies about all the arsing around. It just goes to show how something simple, but not necessarily obvious can really throw a spanner in the works. It's taken us almost a week to figure this out... O.O
I reluctantly had to add an extra foreach loop which is executed for each row, and escapes each field individually, as opposed to before where I tried to do it on a per-row basis.