Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Python
baffling sql string
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="DarkBlue, post: 1947649"] Following is a code snippet from a pythoncard app the problem is with the sql string called iq1 If either mysubject or mytalktext contains an apostrophe the update fails : Example: mysubject="Let's Eat" this fails mysubject="Lets Eat" this works fine What options do I have to avoid this issue but still can use apostrophes in my input data ? mysubject=self.components.TextField1.text mytalktext=self.components.TextArea1.text mymsgno=self.myamsgno iq1="update MSGTALK set msgdate='NOW',subject='%s',talktext='%s' where msgno= %d " % (mysubject,mytalktext,mymsgno) try: self.cur.execute(iq1) con1.commit() self.components.TextArea2.appendText('Update ok\n') except: self.components.TextArea2.appendText('Problem during update command\n') self.components.TextArea2.appendText(iq1) (hope the intendation did not get too messed up ) Thanks [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Python
baffling sql string
Top