MySQLdb LIKE '%%%s%%' problem

gumbah joost.ruyter at gmail.com
Wed Jan 14 05:22:42 EST 2009


Aahh the conn.commit() DID the trick!!

I tried that before, but then it failed at another point. I got it
working now! Thanks a lot Peter and John!!

cheers!

On 14 jan, 11:14, gumbah <joost.ruy... at gmail.com> wrote:
> 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?
>
> > Peter




More information about the Python-list mailing list