lua:db:escape
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| lua:db:escape [2016/02/08 05:16] – vodur | lua:db:escape [2016/02/08 05:35] (current) – vodur | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| db.escape( text ) | db.escape( text ) | ||
| - | Returns the text with necessary escaping for use in sqlite3 statement. | + | Returns the text with necessary escaping for use as a parameter |
| Implemented by passing the text to [[https:// | Implemented by passing the text to [[https:// | ||
| + | |||
| + | <code lua> | ||
| + | local str1=db.escape(" | ||
| + | local str2=db.escape(" | ||
| + | say(str1) | ||
| + | say(str2) | ||
| + | db.exec( ([[INSERT INTO some_table VALUES( ' | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | You say ' | ||
| + | You say ' | ||
| + | </ | ||
lua/db/escape.1454908580.txt.gz · Last modified: 2016/02/08 05:16 by vodur