I'm using the MySQL connector for python 3.x and am getting this issue with simple code like:
rest_cursor.execute("SELECT * FROM restaurant WHERE r_id=%s",(r_id))
where r_id is an integer.
This results in an exception being thrown: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%s' at line 1
This format seems to match the example from the python-MySQL example page: http://dev.mysql.com/doc/connector-python/en/connector-python-example-cursor-select.html.
What am I doing wrong? Thanks