+1
Beantwortet

escaping single quotes

Michael Mikkelsen vor 11 Jahren aktualisiert von icahill (Administrator) vor 11 Jahren 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 "