lua:db:escape
db.escape( text )
Returns the text with necessary escaping for use as a parameter in sqlite3 statement.
Implemented by passing the text to sqlite3_mprintf using "%q" as the format string and text as the argument.
local str1=db.escape("db.escape will not change this string") local str2=db.escape("db.escape won't not change this string") say(str1) say(str2) db.exec( ([[INSERT INTO some_table VALUES( '%s', '%s' )]]):format( str1, str2) )
You say 'db.escape will not change this string' You say 'db.escape won''t not change this string'
lua/db/escape.txt · Last modified: 2016/02/08 05:35 by vodur