I have this pesky bug in my system and i'll try to explain it briefly.
I pull out data from the database and via PHP/HTML output a list of user accounts.
In some cases some of the data in the customer account contains a single quote, e.g:
Mr Joe Bloggs
12 My Street's Name
onclick='useContactDetails("<?php echo mysql_real_escape_string($firstname); ?>","<?php echo mysql_real_escape_string($lastname); ?>","<?php echo mysql_real_escape_string($row['address1']); ?>");'
Error: SyntaxError: unterminated string literal
useContactDetails("Mr","Joe","Bloggs","12 My Street\
How can I get around this problem?
Many Thanks for reading.