Re: Cleaning strings for use in SQL queries
Jacob Smullyan <[email protected]>
| Newsgroups | gmane.comp.web.skunkweb |
|---|---|
| Message-ID | <[email protected]> |
On Wed, Sep 15, 2004 at 08:58:36PM +0000, Andreas Kaempf wrote:
> I am running into some problems with single quotes embedded within form
> input strings causing exceptions when executing SQL queries (the
> apostrophe is interpreted as the closing quote within the query). Before
> writing a routine to clean strings of such stuff, I was wondering
> whether there was already something in SkunkWeb to do this, or if there
> was another source that anyone can recommend.
In SkunkWeb, the PyDO library does escape strings (just s.replace("'",
"\\'")) when you use it. Otherwise you have to do it manually.
Cheers,
js
--
Jacob Smullyan
signature.asc
(application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFBSLDUuqamFyFXXLIRAsubAJ0Y/7uY99RRkz8IVlGtE3DKt9oBtwCgqkay 9Az+Hx5PhLewxEKri21Rak4= =nL1g -----END PGP SIGNATURE-----