Problems with concatenating strings

Paul Everitt (paul@cminds.com)
Wed, 21 Sep 1994 10:27:25 -0500 (CDT)

Hello everyone. I'm stuck with one of those language things that I'm
sure is enormously simple.

I'm using the python bindings to mSQL to create indexed WWW documents.
Here's the problem: I can't use lines of text that have quotes.

For instance, here is my statement for writing the title to the database:
x.Query("update articles set title='"+title+ \
"' where filename='"+filename+"'")

If title="Configuration options for a cisco router", it gets expanded
nicely. If title="Configuration options for cisco's new router", it sees
the ' in cisco's as the termination of the value.

So, how do I handle concatenation when the strings contain arbitrary
amounts of ' and " symbols? It also is giving me problems when I try
writing out my HTML.

TIA.

--Paul

Paul Everitt V 703.785.7384 Email Paul.Everitt@cminds.com
Connecting Minds, Inc. F 703.785.7385 WWW http://www.cminds.com/