sqlEscape

sqlEscape ( object toInsert ) : string


Escape a variable for sql.
Add quote between a string and manage NULL.

Example


name = "Strange'name"

sql = "INSERT INTO CLIENTS (id,name) VALUES (1,"+sqlEscape(name)+")"

console(sql) //  -> INSERT INTO CLIENTS (id,name) VALUES (1,'Strange\'name')

Parameters

toInsert