SQLite and single quote characters

Bob Sneidar bobsneidar at iotecdigital.com
Wed Dec 28 21:11:56 EST 2016


Right. There are a number of things that need to be escaped. Carriage returns, back slashes, linefeeds, etc. Not sure about the whole list, but certain things will bork the insert/update statements.

I give you:
http://stackoverflow.com/questions/1086918/what-characters-have-to-be-escaped-to-prevent-mysql-injections

Bob S


> On Dec 28, 2016, at 11:04 , Devin Asay <devin_asay at byu.edu> wrote:
> 
> Tore,
> 
> I believe you have to escape single quotes in SQL data. See this stackoverflow question:
> 
> https://stackoverflow.com/questions/603572/how-to-properly-escape-a-single-quote-for-a-sqlite-database
> 
> Devin
> 
> 
> On Dec 28, 2016, at 11:54 AM, Tore Nilsen <tore.nilsen at me.com<mailto:tore.nilsen at me.com>> wrote:
> 
> I am using my Christmas break to try to teach myself how to use SQLite with LiveCode. (Hopefully I will be able to teach my students how to use it also, come January.) In this process I ran into a problem, where the script I used did not insert a new record to the database as expected. Some records were created, others were not, but no errors were reported.
> 
> I managed to track it down to the fact that in the instances where it did not work, some of the data I wanted to register included the use of the single quote character. This resulted in no new records being inserted, but LC did not report any errors.
> 
> As a single quote may be a valid character in some instances where I intend to use SQLite databases, I am now at odds with how to proceed. Does anyone have a solution to this problem?
> 
> Regards
> Tore Nilsen
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com<mailto:use-livecode at lists.runrev.com>
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> Devin Asay
> Director
> Office of Digital Humanities
> Brigham Young University
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list