MySQLdb + Python + quotes

Lars Hoeyrup Jensen robinhat at rhk.dk
Wed May 10 03:35:20 EDT 2000


I know, I _had_ found that in the news archives, but as Jeff says: it's a different
MySQL-module from what I use (I use MySQLdb, not MySQL). Therefore it didn't work.

Lars


Fredrik Lundh wrote:

>     > con.execute("INSERT INTO foo (myblob) VALUES ('%s')" % image)
>
>     con.execute("INSERT INTO foo (myblob) VALUES ('%s')" % MySQL.escape(image))
>                                                            ^^^^^^^^^^^^ !!!
>
>     ...
>
> hope this helps!
>
> </F>
>
> <!-- (the eff-bot guide to) the standard python library:
> http://www.pythonware.com/people/fredrik/librarybook.htm
> -->




More information about the Python-list mailing list