Escaping confusion with Python 3 + MySQL

Νίκος Βέργος me.on.nzt at gmail.com
Sun Mar 26 09:34:20 EDT 2017


with import cgitb; cgitb.enable()

ProgrammingError(1064, "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '(pagesID, host, ref, location, useros, browser, visits) VALUES (1, 'cyta.gr', '' at line 1")

that is all i get form error. error_log doesnt produce errors when iam trying

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) )

WHY the valued aren't getting substituted wi the aeguments i give it in to work with?


More information about the Python-list mailing list