Hello, I try to put a file to a mysql database. I readed the HOW-TO: http://www.zope.org/Members/cclljj/howto/image_upload_retrive And when I try it, to import as an external method, i get the next error: Error Type: ImportError Error Value: cannot import name MySQL for this line: from Products.ZMySQLDA import MySQL How can I solve this problem? Or how can I use the MySQL.escape() function? (Because this need it.) Thanks a lot. Amon Tamas sajt@amon.hu
On Wed, 27 Jun 2001, Tamas Amon wrote:
from Products.ZMySQLDA import MySQL
It sounds like you are using an old ZMySQLDA. Try the latest one at http://sourceforge.net/projects/mysql-python However, the product you are using for file uploads seems to be specifically using the MySQL module, instead of MySQLdb or _mysql which is what the 2.x ZMySQLDA uses. To get your existing ZMySQLDA to work, you need MySQLmodule-1.4, which should be included with ZMySQLDA-1.1.x, but needs to be compiled. Check the instructions carefully. If you want to try using ZMySQLDA-2.0.7, you will have to do something like this: from _mysql import string_literal string_literal is probably the quoting function you want (it also adds the quotes); if not, try escape. -- Andy Dustman PGP: 0xC72F3F1D @ .net http://dustman.net/andy I'll give spammers one bite of the apple, but they'll have to guess which bite has the razor blade in it.
participants (2)
-
Andy Dustman -
Tamas Amon