Hi,
I'm having a helluva time dealing with getting data from a MySQL MEMO field, using PHP, into a JavaScript array.
The primary problem I'm having is an unterminated string literal. It's caused by the array declaration line spilling over to multiple lines. This is happening because some of the MySQL data I'm pulling in contains line breaks that aren't caught by my str_replace("\n"," ",$text) function.
This data appears as:
in Navicat (MySQL GUI)
As such, this invisible line break makes its way into the javascript line and breaks my script.
e.g.
var parts = new Array('...','...','...
...');
How can I get around this? I've been googling & spinning my wheels for hours.
Thanks,
--RHYNO
I'm having a helluva time dealing with getting data from a MySQL MEMO field, using PHP, into a JavaScript array.
The primary problem I'm having is an unterminated string literal. It's caused by the array declaration line spilling over to multiple lines. This is happening because some of the MySQL data I'm pulling in contains line breaks that aren't caught by my str_replace("\n"," ",$text) function.
This data appears as:
Code:
1024 Widget
1028 Gadget
As such, this invisible line break makes its way into the javascript line and breaks my script.
e.g.
var parts = new Array('...','...','...
...');
How can I get around this? I've been googling & spinning my wheels for hours.
Thanks,
--RHYNO