Escaping confusion with Python 3 + MySQL

Νίκος Βέργος me.on.nzt at gmail.com
Sun Mar 26 10:24:49 EDT 2017


Τη Κυριακή, 26 Μαρτίου 2017 - 5:19:27 μ.μ. UTC+3, ο χρήστης Ian έγραψε:

> You need to change the placeholders back. The poster who told you to
> replace them was misinformed.

okey altered them back to

cur.execute('''UPDATE visitors SET (pagesID, host, ref, location, useros, browser, visits) VALUES (%s, %s, %s, %s, %s, %s, %s) WHERE host LIKE "%%s%" ''', 
																																			(pID, domain, ref, location, useros, browser, lastvisit, domain) )

but now the problem is how to exact;y type the Where HOST like "%%%"

I MEAN HOW TO DIFFERENTIATE '%S' FROM LITERAL '%' character.



More information about the Python-list mailing list