New topic: 

Dealing with quotation marks - HOW?

<http://forums.realsoftware.com/viewtopic.php?t=45644>

         Page 1 of 1
   [ 5 posts ]                 Previous topic | Next topic          Author  
Message        RickYerex          Post subject: Dealing with quotation marks - 
HOW?Posted: Fri Oct 19, 2012 5:13 pm                         
Joined: Tue Nov 29, 2011 12:50 pm
Posts: 66                How does one save string data type that contains 
quotation marks into a MySQL table without getting an error.

For example, I might have a string "There aren't any choices here" .... the 
word "aren't" which contains a single quote (aka apostrophe) causes the app to 
crash when storing the whole string.   
                             Top                Akiland          Post subject: 
Re: Dealing with quotation marks - HOW?Posted: Fri Oct 19, 2012 5:28 pm         
                        
Joined: Tue Jan 04, 2011 3:02 am
Posts: 973
Location: Jönköping, Sweden                I think they need to be escaped 
like this "There aren\'t any choices here".
Havn't tried though     
_________________

Dev. iMac 27" + 2x22" LG (2.8GHz Intel Core i7, 12GB RAM, 120GB SSD) OS X 10.8
Using Subversion on a Synology DS409+
REAL.Studio Web Edition 2011r3  
                             Top                RickYerex          Post 
subject: Re: Dealing with quotation marks - HOW?Posted: Fri Oct 19, 2012 5:33 
pm                         
Joined: Tue Nov 29, 2011 12:50 pm
Posts: 66                Akiland wrote:I think they need to be escaped like 
this "There aren\'t any choices here".
Havn't tried though 

ya... I've been reading some things about that but haven't come across specific 
ways of doing it.... seems everything I'm finding somehow has to do with PHP 
coding.  I'm using SQL code withing RB to read/write to my MySQL data tables.   
                             Top                charonn0          Post subject: 
Re: Dealing with quotation marks - HOW?Posted: Fri Oct 19, 2012 5:41 pm         
                        
Joined: Mon Apr 02, 2007 2:08 am
Posts: 924
Location: San Francisco, CA, USA                I believe you can escape the 
single quote by using two single quotes:

"There aren''t any choices here"      
_________________
Boredom Software  
                             Top                wbgookin          Post subject: 
Re: Dealing with quotation marks - HOW?Posted: Fri Oct 19, 2012 7:42 pm         
                
Joined: Sat Aug 22, 2009 9:44 am
Posts: 297                Look at #8 and #9 in this thread:
http://forums.realsoftware.com/viewtopic.php?f=3&t=4342   
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 5 posts ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to