MySQLdb LIKE '%%%s%%' problem
joost.ruyter at gmail.com
Wed Jan 14 11:14:09 CET 2009
Yep, also tried that. Weird thing is that I get no errors, it's just
silently not updating...
On 14 jan, 11:06, Peter Otten <__pete... at web.de> wrote:
> gumbah wrote:
> > I tried all of your suggestions but none of them work... I have a clue
> > on why it is failing: MySQLdb seems to quote the % characters or
> > something...
> > Even when i do:
> > cursor.execute("UPDATE tablename set fieldx='test' WHERE flfieldx is
> > null and fieldy like '%therealvalue%' "
> > it is not updating the database...
> > Maybe I am completely overlooking something, but I am pretty lost
> > here... Googling this it seems as if no one is using "LIKE '%value%'"
> > type queries with Python & mySQL...
> > Anyone any other thoughts?
> Did you call the connection object's commit() method?
More information about the Python-list