lua:db:escape
This is an old revision of the document!
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.
lua: geshi 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.1454909700.txt.gz · Last modified: 2016/02/08 05:35 by vodur