Another MySQL Problem

Victor Subervi victorsubervi at gmail.com
Wed Jun 23 09:45:21 EDT 2010


Hi;
I have this line:

  cursor.execute('select clientEmail from clients where client=%s',
(string.replace(client, '_', ' ')))
  clientEmail = cursor.fetchone()[0]
  cursor.execute('select * from %s' % (client))

client = "Lincoln_Properties"
With the replacement, the interpreter complains that mydatabase.Lincoln
doesn't exist. Therefore, the first line of code isn't putting the %s
replacement in quotes, as I was told by you all it would. So I add quotes to
it and the interpreter complains on the second line of code that it's
unsubscriptable (because it's None). What gives?
TIA
beno
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100623/a2c7e391/attachment.html>


More information about the Python-list mailing list