+1
Résolu

escaping single quotes

Michael Mikkelsen il y a 11 ans mis à jour par icahill (Administrator) il y a 11 ans 2
How do I escape the single quotes out of a text string so that I can put it into a SQL Database?
I added this function to functions.html. It works to escape the single quotes but I still have a problem if there are any double quotes in the string.


function dbText(str)
{
str = str.replaceAll("'", "&#39");
return str;
}
This is the nature of XML, it does require XML encoding.

For double quotes you would have to use "