In <[EMAIL PROTECTED]>, Anthra Norell
wrote:

> Try to use % instead of a comma (a Python quirk) and quotes around your
> strings (a MySQL quirk):
> 
>    cursor.execute("INSERT INTO edict (kanji, kana, meaning) VALUES ('%s',
> '%s', '%s')" % ("a", "b", "c") )

AFAIK grumfish made the Right Thingâ.  If you use '%', some interesting
things can happen, e.g. if your values contain "'" characters.  The "%s"s
without quotes and the comma let the DB module format and *escape* the
inserted values for you in a safe way.

Ciao,
        Marc 'BlackJack' Rintsch
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to