MySQLdb, blobs, and inserting

Ng Pheng Siong ngps at madcap.dyn.ml.org
Thu Jan 13 09:52:23 EST 2000


According to Ng Pheng Siong <ngps at post1.com>:
>   c.execute('insert into items (story) values ("%s") % file.read())
>                                                ^^^^
>                                                Note this!

Doh! Need a single quote to close the string, of course:

  c.execute('insert into items (story) values ("%s")' % file.read())
                                                     

-- 
Ng Pheng Siong <ngps at post1.com> * http://www.post1.com/home/ngps




More information about the Python-list mailing list