Apostrophe in text variable causes SQL syntax error

Mark Schonewille m.schonewille at economy-x-talk.com
Thu Sep 13 21:00:50 EDT 2007


Hi Terry,

Yes, this is normal. You need to escape the apostrophe. There should  
be a list of characters that need to be escaped in your MySQL  
documentation somewhere. You can write a script that converts the  
data before sending it to the server.

Best regards,

Mark Schonewille

--

Economy-x-Talk Consulting and Software Engineering
http://economy-x-talk.com
http://www.salery.biz

Quickly extract data from your HyperCard stacks with DIFfersifier.  
http://differsifier.economy-x-talk.com


Op 14-sep-2007, om 2:24 heeft Terry Judd het volgende geschreven:

> I'm trying to poke some text into a field in a mySQL table using  
> some simple
> statements like the following...
>
> put "INSERT INTO screens VALUES(:1,:2,:3)" into tQuery
> revExecuteSQL tID, tQuery, "screenID","screenXML","screenText"
>
> ...(fields 2 and 3 are both TEXT fields) and am getting an SQL  
> syntax error
> if either of the text variables contain an apostrophe. I can escape  
> the
> character I suppose but is this behaviour normal?
>
> Terry...





More information about the use-livecode mailing list