Problem: Some of the comments have NewLine (LF) characters in them. PHP just ignores NewLine characters; javascript treats them as line-enders and complains that the string lacks a closing single quote (“unterminated string literal”), so the transfer doesn't take place.

Solution: I don't know exactly what characters MySQL allows in data fields. I couldn't find a script that would parse input from the data field and insert the javascript escapes, so I decided to bite the bullet and write my own.