Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
cur.execute("SELECT * FROM `productinfo` WHERE CreateDate > '%s'",kakko)
用户输入字符串在哪里kakko,例如 2012-01-15
kakko
“%s”不正确?
因此,从评论中详细说明:
cursor.execute需要一个参数元组,你不需要引用%s:
cursor.execute
%s
cur.execute("SELECT * FROM `productinfo` WHERE CreateDate > %s", (kakko, ))