[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: when I insert table, value is a string contains apostrophe - it throws an error there - how to fix
- From: Florian Weimer <fw@...>
- Date: Wed, 03 Feb 2010 15:11:14 +0100
* noel frankinet:
> you must double the inside quote quote in sql : 'MFD''s web managment'
Ahem. This really depends a lot on the database and on the connection
state. Blindly doubling ' does not work in all cases.
For instance, for PostgreSQL, LuaSQL offers a conn:escape(str) method
which is implemented by the PostgreSQL folks themselves and thus very
likely correct (but the older version wasn't for multi-byte encodings
*sigh*).