Announcement

Collapse
No announcement yet.

Need Help Sqlite

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Need Help Sqlite

    Hello everyone.. Here i am again.. can i ask for a little help about sqlite?

    if am saving a data with ' or with Apostrophe it returns an error

    30001
    SQL logic error or missing database..

    anyone can help me to fix?

    Thank you..

  • #2
    Yes, escape the '

    Code:
    function string:sqlite_escape()
        return self:gsub("'", "''");
    end
    
    function string:sqlite_enquote()
        return ("'%s'"):format(self:sqlite_escape());
    end
    
    local myStr = "Do or don't";
    local escaped = myStr:sqlite_escape();
    local enquoted = myStr:sqlite_enquote();
    
    Dialog.Message("", escaped);
    Dialog.Message("", enquoted);
    Bas Groothedde
    Imagine Programming :: Blog

    AMS8 Plugins
    IMXLH Compiler

    Comment


    • #3
      Hahahha.. thanks for the Imagine Programming it works will.. very much appreciated...

      Comment

      Working...
      X
      😀
      🥰
      🤢
      😎
      😡
      👍
      👎