While building a LiveCode front end to a MySQL database, I ran into the
apostrophe-in-the-data problem. My friend O'Byrne cannot get updated.
For INSERTs, the variable substitution method works great -- I can post
O'Byrne's name as a new record.
But, what should I do about UPDATE ?
Here's my
http://stackoverflow.com/questions/9596652/how-to-escape-apostrophe-in-mysql
On Tue, Oct 8, 2013 at 11:37 PM, Paul Foraker p...@whitefeather.com wrote:
While building a LiveCode front end to a MySQL database, I ran into the
apostrophe-in-the-data problem. My friend O'Byrne cannot get updated.
On 09/10/2013, at 5:37 PM, Paul Foraker wrote:
Any suggestions?
Check your UPDATE syntax:
http://www.w3schools.com/sql/sql_update.asp
Cheers
Monte
--
M E R Goulding
Software development services
Bespoke application development for vertical markets
mergExt - There's an external for that!
Stephen, escaping the single quote with another quote causes the same
error, with the result showing \'\' instead of \'. I tried it with and
without variable substitution.
Monte, my UPDATE syntax was incorrect. Thanks!
In case anyone else needs something like this, here's the code that worked:
On Wed, Oct 9, 2013 at 12:55 AM, Paul Foraker paul.fora...@gmail.comwrote:
Stephen, escaping the single quote with another quote causes the same
error, with the result showing \'\' instead of \'. I tried it with and
without variable substitution.
thanks, Paul. This goes in my Script
On Tue, Oct 8, 2013 at 11:37 PM, Paul Foraker p...@whitefeather.com wrote:
'(last_name,notes) VALUES (O\'Byrne, betting this won\'t work!) WHERE
id=599' at line 1
You're using the wrong escape.
Inside a string, you need a double single quote, not a backslash.
It's worth keeping a preSql()
Don't need to escape anything when using the :1,:2,etc notation, but if you
did, it would be ''' not \'.
The update syntax is UPDATE tablename SET colname=:1 etc
Pete
lcSQL Software
On Oct 9, 2013 3:55 AM, Paul Foraker paul.fora...@gmail.com wrote:
Stephen, escaping the single quote with
On Wed, Oct 9, 2013 at 1:32 AM, stephen barncard
stephenrevoluti...@barncard.com wrote:
Stephen, escaping the single quote with another quote causes the same
error, with the result showing \'\' instead of \'. I tried it with and
without variable substitution.
thanks, Paul. This goes
On Wed, Oct 9, 2013 at 7:02 AM, Dr. Hawkins doch...@gmail.com wrote:
You're using the wrong escape.
Inside a string, you need a double single quote, not a backslash.
It's worth keeping a preSql() function around, like:
function preSQL pSQL
replace ' with '' in pSQL
if pSQL is