+1
Respuestas

escaping single quotes

Michael Mikkelsen hace 12 años actualizado por icahill (Administrator) hace 12 años 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 "